mx.com.brained.actions
Class ResourceAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by mx.com.brained.actions.ResourceAction

public class ResourceAction
extends org.apache.struts.action.Action

Title: AwTaglib

Description: Special action that handles reading and loading of special resources (usually js or png files) located in the classpath.
It requires two parameters for it to work properly:

Copyright: Copyright (c) 2005

Company: Brain-ED

Version:
1.0
Author:
Isidoro Treviņo

Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ResourceAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The main method that will be executed to send through the ServletOutputStream the contents of the file
 void setResource(ResourceManagerIface resource)
          Method to set the proper Resource Manager (the class that itself loads the required files)
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceAction

public ResourceAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
The main method that will be executed to send through the ServletOutputStream the contents of the file

Overrides:
execute in class org.apache.struts.action.Action
Parameters:
mapping - ActionMapping
form - ActionForm
request - HttpServletRequest
response - HttpServletResponse
Returns:
ActionForward returns null because it directly writes a binary output
Throws:
java.lang.Exception - if any error occurs (usually a file not found on classpath)

setResource

public void setResource(ResourceManagerIface resource)
Method to set the proper Resource Manager (the class that itself loads the required files)

Parameters:
resource - ResourceManagerIface


Copyright © 2005 Brain-ED Engineering & Development. All Rights Reserved.