Web / Apache OFBiz Interview questions
Explain the execution flow of an inbound web request through OFBiz's Control Servlet?
sequenceDiagram
participant Browser
participant ControlServlet
participant RequestHandler
participant Event
participant View as Screen/View
Browser->>ControlServlet: HTTP request to /control/orderview
ControlServlet->>RequestHandler: dispatch
RequestHandler->>RequestHandler: look up request in controller.xml
RequestHandler->>Event: run event handler (optional)
Event-->>RequestHandler: response code, success or error
RequestHandler->>View: render view mapped to response code
View-->>Browser: rendered HTML
Every URL under /control/ is mapped in a webapp's controller.xml to a request definition, which can name a security setting (auth required, HTTPS required), an optional event (a Java, Groovy, or service handler that runs before rendering), and one or more possible response targets, each pointing to a view (usually a screen).
The event's returned response string (commonly success or error) determines which response and view is rendered next, which is how a single request definition can show a form on GET and, on a POST failure, redisplay the same form with error messages instead of the success view.
More Related questions...