ro.isdc.wro.http.handler
Class ResourceProxyRequestHandler

java.lang.Object
  extended by ro.isdc.wro.http.handler.RequestHandlerSupport
      extended by ro.isdc.wro.http.handler.ResourceProxyRequestHandler
All Implemented Interfaces:
RequestHandler

public class ResourceProxyRequestHandler
extends RequestHandlerSupport

Provides access to wro resources via a resource proxy.

Since:
1.4.7
Author:
Ivar Conradi Ă˜sthus

Field Summary
static String ALIAS
          The alias of this RequestHandler used for configuration.
static String PARAM_RESOURCE_ID
           
static String PATH_RESOURCES
           
 
Fields inherited from class ro.isdc.wro.http.handler.RequestHandlerSupport
PATH_API
 
Constructor Summary
ResourceProxyRequestHandler()
           
 
Method Summary
 boolean accept(javax.servlet.http.HttpServletRequest request)
          Determines if current request can be handled by this requestHandler
 void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle the given request, generating a response.
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()
           
 
Methods inherited from class ro.isdc.wro.http.handler.RequestHandlerSupport
isEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_RESOURCE_ID

public static final String PARAM_RESOURCE_ID
See Also:
Constant Field Values

PATH_RESOURCES

public static final String PATH_RESOURCES
See Also:
Constant Field Values

ALIAS

public static final String ALIAS
The alias of this RequestHandler used for configuration.

See Also:
Constant Field Values
Constructor Detail

ResourceProxyRequestHandler

public ResourceProxyRequestHandler()
Method Detail

handle

public void handle(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws IOException
Handle the given request, generating a response.

Specified by:
handle in interface RequestHandler
Overrides:
handle in class RequestHandlerSupport
Parameters:
request - current HTTP request
response - current HTTP response
Throws:
IOException - in case of I/O errors

accept

public boolean accept(javax.servlet.http.HttpServletRequest request)
Determines if current request can be handled by this requestHandler

Specified by:
accept in interface RequestHandler
Overrides:
accept in class RequestHandlerSupport
Parameters:
request - current HTTP request
Returns:
true if this requestHandler should handle this request

isResourceChanged

protected boolean isResourceChanged(javax.servlet.http.HttpServletRequest request)
Used to identify whether the 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.

Returns:
true if the requested resource is changed on the server and the latest version should be returned.

newResponseHeadersConfigurer

protected ResponseHeadersConfigurer newResponseHeadersConfigurer()
Returns:
the ResponseHeadersConfigurer.


Copyright © 2008-2013. All Rights Reserved.