org.loom.tags.core
Class AbstractWebResourceTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by org.loom.tags.AbstractTag
          extended by org.loom.tags.core.AbstractWebResourceTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag, LoomTag, ParameterContainer
Direct Known Subclasses:
CssTag, ScriptTag

public abstract class AbstractWebResourceTag
extends AbstractTag
implements ParameterContainer

Tag that creates a link to a script or css file. There are two common uses for this tag: <l:script src="/js/myfile.js"/> This tag will create a normal script tag, pointing to the specified resource with the webapp prefix prepended. <l:script resource="resource_path"/> When specifying the resource, it will use a resource bundle configured using spring.

Author:
icoloma

Field Summary
static java.lang.Integer IE_ANY
          include the library with any version of IE
 
Fields inherited from class org.loom.tags.AbstractTag
out, repository, request, response
 
Constructor Summary
AbstractWebResourceTag()
           
 
Method Summary
 AbstractWebResourceTag addParameter(java.lang.String name, java.lang.Object value)
          Adds a parameter to the resulting url
 void doTagImpl()
          The method that must be implemented by the child class
protected  void endTag()
          Does the tag cleanup, if any.
protected  java.lang.String getContents()
           
 java.lang.String getResource()
           
protected abstract  java.lang.Class<? extends Action> getResourcesActionClass()
           
protected  java.lang.String getType()
           
 UrlBuilder getUrl()
           
protected  UrlBuilder getUrlBuilder()
           
 WebResourceBundleRepository getWebResourceBundleRepository()
           
 WebResourcesRepository getWebResourcesRepository()
           
protected  void initTag()
          Initializes the tag attributes
 boolean isDevelopment()
           
protected abstract  void printTag()
          print just the tag
 void setAction(java.lang.String action)
           
 void setDevelopment(boolean development)
           
 void setEvent(java.lang.String event)
           
 void setIe(java.lang.String ie)
          Deprecated. use ieLessThan instead. To be removed for loom 1.1
 void setIeLessThan(java.lang.String ie)
           
protected  void setRawUrl(java.lang.String rawUrl)
           
 void setResource(java.lang.String resourceName)
           
protected  void setType(java.lang.String type)
           
 void setWebResourceBundleRepository(WebResourceBundleRepository bundleRepository)
           
 void setWebResourcesRepository(WebResourcesRepository resourcesRepository)
           
 
Methods inherited from class org.loom.tags.AbstractTag
createWriterWrapper, doBody, doBufferedBody, doTag, evaluateExpression, getActionProperty, getAncestorWithClass, getBufferedBody, getExtendedAttributes, getMessagesRepository, getPageContext, getRequest, getResponse, getScopedAttribute, getWriter, printParentAttributes, removeScopedAttribute, setDynamicAttribute, setExtendedAttribute, setRequest, setResponse, setScopedAttribute, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IE_ANY

public static final java.lang.Integer IE_ANY
include the library with any version of IE

Constructor Detail

AbstractWebResourceTag

public AbstractWebResourceTag()
Method Detail

initTag

protected void initTag()
Description copied from class: AbstractTag
Initializes the tag attributes

Overrides:
initTag in class AbstractTag

doTagImpl

public void doTagImpl()
               throws javax.servlet.jsp.JspException,
                      java.io.IOException
Description copied from class: AbstractTag
The method that must be implemented by the child class

Specified by:
doTagImpl in class AbstractTag
Throws:
javax.servlet.jsp.JspException
java.io.IOException

getResourcesActionClass

protected abstract java.lang.Class<? extends Action> getResourcesActionClass()
Returns:
the class of the action that will handle requests from this tag.

printTag

protected abstract void printTag()
                          throws javax.servlet.jsp.JspException,
                                 java.io.IOException
print just the tag

Throws:
javax.servlet.jsp.JspException
java.io.IOException

endTag

protected void endTag()
Description copied from class: AbstractTag
Does the tag cleanup, if any.

Overrides:
endTag in class AbstractTag

getContents

protected java.lang.String getContents()

setAction

public void setAction(java.lang.String action)

setEvent

public void setEvent(java.lang.String event)

setResource

public void setResource(java.lang.String resourceName)

addParameter

public AbstractWebResourceTag addParameter(java.lang.String name,
                                           java.lang.Object value)
Description copied from interface: ParameterContainer
Adds a parameter to the resulting url

Specified by:
addParameter in interface ParameterContainer
Parameters:
name - the name of the parameter
value - the value of the parameter
Returns:
the same instance of ParameterContainer, to allow nested calls.

setIe

public void setIe(java.lang.String ie)
Deprecated. use ieLessThan instead. To be removed for loom 1.1


setIeLessThan

public void setIeLessThan(java.lang.String ie)

setRawUrl

protected void setRawUrl(java.lang.String rawUrl)

getUrl

public UrlBuilder getUrl()

isDevelopment

public boolean isDevelopment()

setDevelopment

public void setDevelopment(boolean development)

getResource

public java.lang.String getResource()

getWebResourceBundleRepository

public WebResourceBundleRepository getWebResourceBundleRepository()

setWebResourceBundleRepository

public void setWebResourceBundleRepository(WebResourceBundleRepository bundleRepository)

getWebResourcesRepository

public WebResourcesRepository getWebResourcesRepository()

setWebResourcesRepository

public void setWebResourcesRepository(WebResourcesRepository resourcesRepository)

getType

protected java.lang.String getType()

setType

protected void setType(java.lang.String type)

getUrlBuilder

protected UrlBuilder getUrlBuilder()


The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.