Writing an OFBiz Java Event is as simple as writing a Java method and then configuring OFBiz to be able to find the Event on the Java CLASSPATH. When would you want to write a Java Event? Any time you want to process input from a web application, such as the submission of an HTML form entry or as a result of a URL request, an Event may be coded to accept the HTTP/HTTPS request and return a response object to the browser.
When writing your first Event, it is often easier to add your Event's method to an existing Java class file. Any existing class file will work. Remember that the OFBiz convention is to add an "Events.java" suffix to class files containing Events.
To start writing Events, the following have to be taken care of:
1. Decide which Component you want your OFBiz Event to run in.
2. Check for Java build/compile dependencies in the
build.xml
file for every Component you selected in step 1.3. Create your
controller.xml
file request-mapping entry...