Package org.apache.ofbiz.webapp
Class WebAppUtil
- java.lang.Object
-
- org.apache.ofbiz.webapp.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 Summary
Fields Modifier and Type Field Description static java.lang.String
CONTROL_MOUNT_POINT
static java.lang.String
module
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getControlServletPath(ComponentConfig.WebappInfo webAppInfo)
Returns the control servlet path.static Delegator
getDelegator(javax.servlet.ServletContext servletContext)
static LocalDispatcher
getDispatcher(javax.servlet.ServletContext servletContext)
static Security
getSecurity(javax.servlet.ServletContext servletContext)
static ComponentConfig.WebappInfo
getWebappInfoFromWebsiteId(java.lang.String webSiteId)
Returns theWebappInfo
instance associated to the specified web site ID.static java.lang.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
isDistributable(ComponentConfig.WebappInfo appinfo)
static LocalDispatcher
makeWebappDispatcher(javax.servlet.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
setAttributesFromRequestBody(javax.servlet.ServletRequest request)
-
-
-
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 theofbiz-component.xml
file and the servlet mapping specified in the web application'sweb.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 theWebappInfo
instance associated to the specified web site ID. ThrowsIllegalArgumentException
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'sweb.xml
file, ornull
if no web site ID was found.- Parameters:
webAppInfo
-- Throws:
java.io.IOException
org.xml.sax.SAXException
-
getDispatcher
public static LocalDispatcher getDispatcher(javax.servlet.ServletContext servletContext)
-
setAttributesFromRequestBody
public static void setAttributesFromRequestBody(javax.servlet.ServletRequest request)
-
makeWebappDispatcher
public static LocalDispatcher makeWebappDispatcher(javax.servlet.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
public static Delegator getDelegator(javax.servlet.ServletContext servletContext)
-
getSecurity
public static Security getSecurity(javax.servlet.ServletContext servletContext)
-
-