Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • What data does it show.
  • How does it present that data.

A screen is usually displayed as the result of a request. In a webapp this is going to be an HTTP request, for example:

http://www.yourserver.com/partymgr/control/main

Most OFBiz URLs follow that pattern. The first part after the server name selects the webapp which is supposed to process this request. In this case, the request is for the partymgr webapp. The next part, control, determines that this request should be processed by the Controller Servlet. (See the mapping in web.xml in each webapp.) The Controller Servlet uses the control.xml file in the webapp's WEB-INF folder to decide what content to serve in response to this request.

Panel

Hint: If you wanted to integrate any functionality into OFBiz which you don't want to base on the Controller Servlet, you can use any URL namespace expect control and map it to your custom servlet.

How the Controller Servlet handles a request

The Controller Servlet is configured using the control.xml file in the WEB-INF folder. That file has three kind of XML elements which are important now:

  1. handler
  2. request-map
  3. view-map

While this is the order in which they typically appear in the control.xml file, let's start with the request-map.

Element: request-map 

Attributes: uri

Children: security, event, response

The uri attribute is used to match a request-map to the actual request. Kind in mind that the webapp name and control have already been matched by the servlet container to dispatch processing here. Therefore in our example, the remainder of the URL to match here is just main.

The request map for the URI main looks like this:

The security element specifies that https is required (https="true") and that this portion of the application required proper user authentication and authorization (auth="true"). Parts of the application which do not require either one are the online store, for example.

There is no event triggered by this request, so no processing happens in this case, as we do not have an event element. In case there is no processing, an outcome of success is the defaultMake sure you are clear that "look and feel" only covers the latter aspect.