public class ResourceProxyRequestHandler extends RequestHandlerSupport
?wroAPI=wroResources?id=/path/to/resourceId.jsNotice that this uri has the following mandatory parameters:
| Modifier and Type | Field and Description |
|---|---|
static String |
ALIAS
The alias of this
RequestHandler used for configuration. |
static String |
PARAM_RESOURCE_ID |
static String |
PATH_RESOURCES |
PATH_API| Constructor and Description |
|---|
ResourceProxyRequestHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(javax.servlet.http.HttpServletRequest request)
Determines if current request can be handled by this requestHandler
|
static String |
createProxyPath(String requestUri,
String resourceId)
Builds the request path for this request handler using the assumption that
WroFilter has a mapping ending
with a * character. |
void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle the given request, generating a response.
|
static boolean |
isProxyUri(String url)
Checks if the provided url is a resource proxy request.
|
protected boolean |
isResourceChanged(javax.servlet.http.HttpServletRequest request)
Used to identify whether the
HttpServletResponse.SC_NOT_MODIFIED or HttpServletResponse.SC_OK
should be returned. |
protected ResponseHeadersConfigurer |
newResponseHeadersConfigurer() |
isEnabledpublic static final String PARAM_RESOURCE_ID
public static final String PATH_RESOURCES
public static final String ALIAS
RequestHandler used for configuration.public void handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
RequestHandlerhandle in interface RequestHandlerhandle in class RequestHandlerSupportrequest - current HTTP requestresponse - current HTTP responseIOException - in case of I/O errorspublic boolean accept(javax.servlet.http.HttpServletRequest request)
RequestHandleraccept in interface RequestHandleraccept in class RequestHandlerSupportrequest - current HTTP requestprotected boolean isResourceChanged(javax.servlet.http.HttpServletRequest request)
HttpServletResponse.SC_NOT_MODIFIED or HttpServletResponse.SC_OK
should be returned. Currently a single timestamp is used to detect the change for all resources. This might be no
accurate, but at least it allows sending NOT_MODIFIED header much often resulting in less load on the server.
Override this method if a different way detecting change is required.protected ResponseHeadersConfigurer newResponseHeadersConfigurer()
ResponseHeadersConfigurer.public static String createProxyPath(String requestUri, String resourceId)
WroFilter has a mapping ending
with a * character.requestUri - of wro request used to compute the path to this request handler. This request uri is required, because we
do not know how the wro filter is mapped.public static boolean isProxyUri(String url)
url - to check.Copyright © 2008-2014. All Rights Reserved.