Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5037

ControlServlet - Exception thrown for requests not defined by controller.xml

    XMLWordPrintableJSON

Details

    Description

      The current rendering within OFBiz expects the following setup:

      • Request is always submit against /control
      • /control will pickup the request and handle by ControlServlet
      • ControlServlet will check within controller.xml for an entry

      Because of it, the ControlServlet will intercept any request coming towards the application, except for requests that are mapped against similar servlets (/cms or alike). ControlServlet will throw an exception if no request is found and try to redirect towards an error page.

      The underlying assumption here is that ControlServlet is always in the lead for rendering pages, unless the internal CMS is used. This does not have to be the case, however, since in practice it is also possible for users to implement a replacing cms or other means for rendering the pages. In those cases ControlServlet will still throw an error, albeit the request may already have been handled by a wrapping system:

      2012-09-18 09:54:22,869 (http-0.0.0.0-8080-13) [ ControlServlet.java:141:INFO ] [[[fm1] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
      2012-09-18 09:54:22,870 (http-0.0.0.0-8080-13) [ ControlServlet.java:227:ERROR] ---- exception report ---------------------------------------------------------- Error in request handler: Exception: org.ofbiz.webapp.control.RequestHandlerException Message: Unknown request [fm1]; this request does not exist or cannot be called directly. ---- stack trace --------------------------------------------------------------- org.ofbiz.webapp.control.RequestHandlerException: Unknown request [fm1]; this request does not exist or cannot be called directly. org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:146) org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:224) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
      

      Since this is a minor issue, I propose to remove the underlying exception and rather throw a warning instead. This would allow the users to extend the Servlet by their own means and yet allow the purpose to remain unchanged (clearly a logged message is wanted here). I will attach a patch to fix the issue.

      Attachments

        1. OFBIZ-5037.patch
          7 kB
          Jacques Le Roux
        2. OFBIZ-5037.patch
          7 kB
          Jacques Le Roux

        Activity

          People

            jleroux Jacques Le Roux
            madppiper Paul Piper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified