Package org.apache.ofbiz.webapp
Class WebAppUtil
java.lang.Object
org.apache.ofbiz.webapp.WebAppUtil
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getControlServletPath
(ComponentConfig.WebappInfo webAppInfo) Returns the control servlet path.static Delegator
getDelegator
(ServletContext servletContext) static LocalDispatcher
getDispatcher
(ServletContext servletContext) static Security
getSecurity
(ServletContext servletContext) static ComponentConfig.WebappInfo
getWebappInfoFromWebsiteId
(String webSiteId) Returns theWebappInfo
instance associated to the specified web site ID.static String
getWebSiteId
(ComponentConfig.WebappInfo webAppInfo) Returns the web site ID - as configured in the web application'sweb.xml
file, ornull
if no web site ID was found.static boolean
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 itstatic void
-
Field Details
-
CONTROL_MOUNT_POINT
- See Also:
-
-
Method Details
-
getControlServletPath
public static String getControlServletPath(ComponentConfig.WebappInfo webAppInfo) throws IOException, SAXException Returns the control servlet path. The path consists of the web application's mount-point specified in theofbiz-component.xml
file and the servlet mapping specified in the web application'sweb.xml
file.- Parameters:
webAppInfo
-- Throws:
IOException
SAXException
-
isDistributable
public static boolean isDistributable(ComponentConfig.WebappInfo appinfo) throws IOException, SAXException - Throws:
IOException
SAXException
-
getWebappInfoFromWebsiteId
public static ComponentConfig.WebappInfo getWebappInfoFromWebsiteId(String webSiteId) throws IOException, SAXException Returns theWebappInfo
instance associated to the specified web site ID. ThrowsIllegalArgumentException
if the web site ID was not found.- Parameters:
webSiteId
-- Throws:
IOException
SAXException
-
getWebSiteId
public static String getWebSiteId(ComponentConfig.WebappInfo webAppInfo) throws IOException, SAXException Returns the web site ID - as configured in the web application'sweb.xml
file, ornull
if no web site ID was found.- Parameters:
webAppInfo
-- Throws:
IOException
SAXException
-
getDispatcher
-
setAttributesFromRequestBody
-
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 -
getDelegator
-
getSecurity
-