Class ScriptEventHandler

java.lang.Object
org.apache.ofbiz.webapp.event.ScriptEventHandler
All Implemented Interfaces:
EventHandler

public final class ScriptEventHandler extends Object implements EventHandler
Generic Script Event Handler. This event handler uses the javax.script package (JSR-223) to invoke scripts or script functions.

The script event handler will put the following artifacts in the script engine's bindings:

  • parameters - a Map containing servlet context, session, request attributes and parameters
  • request - a HttpServletRequest instance
  • response - a HttpServletResponse instance
  • session - a HttpSession instance
  • dispatcher - a LocalDispatcher instance
  • delegator - a Delegator instance
  • security - a Security instance
  • locale - a Locale instance
  • timeZone - a TimeZone instance
  • userLogin - a UserLogin GenericValue

If the event element includes an invoke attribute, then the matching script function/method will be called with a single argument - the bindings Map.