org.apache.click.service
Interface ResourceService

All Known Implementing Classes:
ClickResourceService

public interface ResourceService

Provides a static resource service interface.

Configuration

The default ResourceService is ClickResourceService.

However you can instruct Click to use a different implementation by adding the following element to your click.xml configuration file.

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <click-app charset="UTF-8">

     <pages package="com.mycorp.page"/>

     <resource-service classname="com.mycorp.service.DynamicResourceService">

 </click-app> 


Method Summary
 boolean isResourceRequest(HttpServletRequest request)
          Return true if the request is for a static resource.
 void onDestroy()
          Destroy the ResourceService.
 void onInit(ServletContext servletContext)
          Initialize the ResourceService with the given application configuration service instance.
 void renderResource(HttpServletRequest request, HttpServletResponse response)
          Render the resource request to the given servlet resource response.
 

Method Detail

onInit

void onInit(ServletContext servletContext)
            throws IOException
Initialize the ResourceService with the given application configuration service instance.

This method is invoked after the ResourceService has been constructed.

Parameters:
servletContext - the application servlet context
Throws:
IOException - if an IO error occurs initializing the service

onDestroy

void onDestroy()
Destroy the ResourceService.


isResourceRequest

boolean isResourceRequest(HttpServletRequest request)
Return true if the request is for a static resource.

Parameters:
request - the servlet request
Returns:
true if the request is for a static resource

renderResource

void renderResource(HttpServletRequest request,
                    HttpServletResponse response)
                    throws IOException
Render the resource request to the given servlet resource response.

Parameters:
request - the servlet resource request
response - the servlet response
Throws:
IOException - if an IO error occurs rendering the resource