Class WebAppUtil


  • public final class WebAppUtil
    extends java.lang.Object
    Web application utilities.

    This class reuses some of the Tomcat/Catalina classes for convenience, but OFBiz does not need to be running on Tomcat for this to work.

    • Field Detail

      • module

        public static final java.lang.String module
      • CONTROL_MOUNT_POINT

        public static final java.lang.String CONTROL_MOUNT_POINT
        See Also:
        Constant Field Values
    • Method Detail

      • getControlServletPath

        public static java.lang.String getControlServletPath​(ComponentConfig.WebappInfo webAppInfo)
                                                      throws java.io.IOException,
                                                             org.xml.sax.SAXException
        Returns the control servlet path. The path consists of the web application's mount-point specified in the ofbiz-component.xml file and the servlet mapping specified in the web application's web.xml file.
        Parameters:
        webAppInfo -
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • isDistributable

        public static boolean isDistributable​(ComponentConfig.WebappInfo appinfo)
                                       throws java.io.IOException,
                                              org.xml.sax.SAXException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • getWebappInfoFromWebsiteId

        public static ComponentConfig.WebappInfo getWebappInfoFromWebsiteId​(java.lang.String webSiteId)
                                                                     throws java.io.IOException,
                                                                            org.xml.sax.SAXException
        Returns the WebappInfo instance associated to the specified web site ID. Throws IllegalArgumentException if the web site ID was not found.
        Parameters:
        webSiteId -
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • getWebSiteId

        public static java.lang.String getWebSiteId​(ComponentConfig.WebappInfo webAppInfo)
                                             throws java.io.IOException,
                                                    org.xml.sax.SAXException
        Returns the web site ID - as configured in the web application's web.xml file, or null if no web site ID was found.
        Parameters:
        webAppInfo -
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
      • setAttributesFromRequestBody

        public static void setAttributesFromRequestBody​(ServletRequest request)
      • makeWebappDispatcher

        public static LocalDispatcher makeWebappDispatcher​(ServletContext servletContext,
                                                           Delegator delegator)
        This method only sets up a dispatcher for the current webapp and passed in delegator, it does not save it to the ServletContext or anywhere else, just returns it