Package org.apache.ofbiz.webapp.control
Class RequestHandler
- java.lang.Object
-
- org.apache.ofbiz.webapp.control.RequestHandler
-
public class RequestHandler extends java.lang.Object
RequestHandler - Request Processor Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doRequest(HttpServletRequest request, HttpServletResponse response, java.lang.String chain, GenericValue userLogin, Delegator delegator)
ConfigXMLReader.ControllerConfig
getControllerConfig()
java.lang.String
getDefaultErrorPage(HttpServletRequest request)
Returns the default error page for this request.EventFactory
getEventFactory()
Returns the EventFactory Object.static java.lang.String
getOverrideViewUri(java.lang.String path)
static RequestHandler
getRequestHandler(ServletContext servletContext)
static java.lang.String
getRequestUri(java.lang.String path)
java.lang.String
getStatusCode(HttpServletRequest request)
Returns the default status-code for this request.ViewFactory
getViewFactory()
Returns the ViewFactory Object.java.lang.String
makeLink(HttpServletRequest request, HttpServletResponse response, java.lang.String url)
java.lang.String
makeLink(HttpServletRequest request, HttpServletResponse response, java.lang.String url, boolean fullPath, boolean secure, boolean encode)
java.lang.String
makeLinkWithQueryString(HttpServletRequest request, HttpServletResponse response, java.lang.String url, ConfigXMLReader.RequestResponse requestResponse)
java.lang.String
makeQueryString(HttpServletRequest request, ConfigXMLReader.RequestResponse requestResponse)
Creates a query string based on the redirect parameters for a request response, if specified, or for all request parameters if no redirect parameters are specified.static java.lang.String
makeUrl(HttpServletRequest request, HttpServletResponse response, java.lang.String url)
static java.lang.String
makeUrl(HttpServletRequest request, HttpServletResponse response, java.lang.String url, boolean fullPath, boolean secure, boolean encode)
void
runAfterLoginEvents(HttpServletRequest req, HttpServletResponse resp)
Run all the "after-login" Web events defined in the controller configuration.void
runBeforeLogoutEvents(HttpServletRequest req, HttpServletResponse resp)
Run all the "before-logout" Web events defined in the controller configuration.java.lang.String
runEvent(HttpServletRequest request, HttpServletResponse response, ConfigXMLReader.Event event, ConfigXMLReader.RequestMap requestMap, java.lang.String trigger)
Find the event handler and invoke an event.boolean
trackStats(HttpServletRequest request)
boolean
trackVisit(HttpServletRequest request)
-
-
-
Method Detail
-
getRequestHandler
public static RequestHandler getRequestHandler(ServletContext servletContext)
-
getControllerConfig
public ConfigXMLReader.ControllerConfig getControllerConfig()
-
doRequest
public void doRequest(HttpServletRequest request, HttpServletResponse response, java.lang.String chain, GenericValue userLogin, Delegator delegator) throws RequestHandlerException, RequestHandlerExceptionAllowExternalRequests
-
runEvent
public java.lang.String runEvent(HttpServletRequest request, HttpServletResponse response, ConfigXMLReader.Event event, ConfigXMLReader.RequestMap requestMap, java.lang.String trigger) throws EventHandlerException
Find the event handler and invoke an event.- Throws:
EventHandlerException
-
getDefaultErrorPage
public java.lang.String getDefaultErrorPage(HttpServletRequest request)
Returns the default error page for this request.
-
getStatusCode
public java.lang.String getStatusCode(HttpServletRequest request)
Returns the default status-code for this request.
-
getViewFactory
public ViewFactory getViewFactory()
Returns the ViewFactory Object.
-
getEventFactory
public EventFactory getEventFactory()
Returns the EventFactory Object.
-
getRequestUri
public static java.lang.String getRequestUri(java.lang.String path)
-
getOverrideViewUri
public static java.lang.String getOverrideViewUri(java.lang.String path)
-
makeQueryString
public java.lang.String makeQueryString(HttpServletRequest request, ConfigXMLReader.RequestResponse requestResponse)
Creates a query string based on the redirect parameters for a request response, if specified, or for all request parameters if no redirect parameters are specified.- Parameters:
request
- the Http requestrequestResponse
- the RequestResponse Object- Returns:
- return the query string
-
makeLinkWithQueryString
public java.lang.String makeLinkWithQueryString(HttpServletRequest request, HttpServletResponse response, java.lang.String url, ConfigXMLReader.RequestResponse requestResponse)
-
makeLink
public java.lang.String makeLink(HttpServletRequest request, HttpServletResponse response, java.lang.String url)
-
makeLink
public java.lang.String makeLink(HttpServletRequest request, HttpServletResponse response, java.lang.String url, boolean fullPath, boolean secure, boolean encode)
-
makeUrl
public static java.lang.String makeUrl(HttpServletRequest request, HttpServletResponse response, java.lang.String url)
-
makeUrl
public static java.lang.String makeUrl(HttpServletRequest request, HttpServletResponse response, java.lang.String url, boolean fullPath, boolean secure, boolean encode)
-
runAfterLoginEvents
public void runAfterLoginEvents(HttpServletRequest req, HttpServletResponse resp)
Run all the "after-login" Web events defined in the controller configuration.- Parameters:
req
- the request to run the events withresp
- the response to run the events with
-
runBeforeLogoutEvents
public void runBeforeLogoutEvents(HttpServletRequest req, HttpServletResponse resp)
Run all the "before-logout" Web events defined in the controller configuration.- Parameters:
req
- the request to run the events withresp
- the response to run the events with
-
trackStats
public boolean trackStats(HttpServletRequest request)
-
trackVisit
public boolean trackVisit(HttpServletRequest request)
-
-