org.ultrawork.wtk.helper.taglib
Class UseTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.ultrawork.wtk.helper.taglib.UseTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class UseTag
extends javax.servlet.jsp.tagext.TagSupport

Expose a ViewHelper instance as a scripting variable if it is found in the request scope, either under the default key or under the key specifed by the id attribute. Otherwise Instantiate a ViewHelper object and expose it as a scripting variable in the page scope.

Version:
0.1
Author:
Nicolas Bonvin
See Also:
Serialized Form

Field Summary
protected  java.lang.String id
          The name of the scripting variable that will be exposed inside of the Tag.
private  java.lang.String name
           
protected  java.lang.String type
          The fully qualified Java class name of the ViewHelper to create.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext, parent, values
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
UseTag()
           
 
Method Summary
 int doStartTag()
          If a ViewHelper instance is found in the request scope, either under the default key or under the key specifed by the id attribute, expose it as a scripting variable in the page scope.
private  ViewHelper getHelperFromRequestScope()
           
 java.lang.String getId()
           
 java.lang.String getName()
           
 java.lang.String getType()
           
 void setId(java.lang.String id)
           
 void setName(java.lang.String name)
           
 void setType(java.lang.String type)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id
The name of the scripting variable that will be exposed inside of the Tag.

type

protected java.lang.String type
The fully qualified Java class name of the ViewHelper to create.

name

private java.lang.String name
Constructor Detail

UseTag

public UseTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
If a ViewHelper instance is found in the request scope, either under the default key or under the key specifed by the id attribute, expose it as a scripting variable in the page scope. Otherwise Instantiate a ViewHelper object and expose it as a scripting variable in the page scope.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspTagException - if a Tag exception has occurred

getHelperFromRequestScope

private ViewHelper getHelperFromRequestScope()

getId

public java.lang.String getId()
Overrides:
getId in class javax.servlet.jsp.tagext.TagSupport

setId

public void setId(java.lang.String id)
Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)


Copyright 2002 - ultrawork