|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport org.apache.struts.tiles.taglib.DefinitionTagSupport org.apache.struts.tiles.taglib.InsertTag
public class InsertTag
This is the tag handler for <tiles:insert>, which includes a template. The tag's body content consists of <tiles:put> tags, which are accessed by <tiles:get> in the template.
Nested Class Summary | |
---|---|
protected class |
InsertTag.DirectStringHandler
Handle insert direct string. |
protected class |
InsertTag.InsertHandler
Real handler, after attribute resolution. |
protected static interface |
InsertTag.TagHandler
Inner Interface. |
Field Summary | |
---|---|
protected String |
attribute
Name of attribute from which to read page name to include. |
protected String |
beanName
Name of bean used as entity to include. |
protected String |
beanProperty
Name of bean property, if any. |
protected String |
beanScope
Scope of bean, if any. |
protected ComponentContext |
cachedCurrentContext
Current component context. |
protected String |
definitionName
Name of component instance to include. |
protected boolean |
flush
Flush attribute value. |
protected boolean |
isErrorIgnored
Are errors ignored. |
protected static Log |
log
Commons Logging instance. |
protected String |
name
Name to insert. |
protected PageContext |
pageContext
Trick to allows inner classes to access pageContext. |
protected boolean |
processEndTag
Does the end tag need to be processed. |
static String |
ROLE_DELIMITER
Deprecated. This will be removed in a release after Struts 1.2. |
protected InsertTag.TagHandler |
tagHandler
Final handler of tag methods. |
Fields inherited from class org.apache.struts.tiles.taglib.DefinitionTagSupport |
---|
controllerName, controllerType, page, role |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id |
Fields inherited from interface org.apache.struts.tiles.taglib.ComponentConstants |
---|
COMPONENT_CONTEXT, COMPONENT_SCOPE, EXCEPTION_KEY, LOCALE_KEY |
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 | |
---|---|
InsertTag()
|
Method Summary | |
---|---|
InsertTag.TagHandler |
createTagHandler()
Process tag attribute and create corresponding tag handler. |
int |
doEndTag()
Process the end tag by including the template. |
protected void |
doInclude(String page,
boolean flush)
Do an include of specified page. |
int |
doStartTag()
Process the start tag by checking tag's attributes and creating appropriate handler. |
String |
getBeanName()
Get bean name. |
String |
getBeanProperty()
Get bean property. |
String |
getBeanScope()
Get bean scope. |
String |
getDefinitionName()
Get definition name. |
boolean |
getFlush()
Get flush. |
boolean |
getIgnore()
Get ignore. |
String |
getName()
Get name. |
PageContext |
getPageContext()
Get the pageContext property. |
InsertTag.TagHandler |
processAsDefinitionOrURL(String name)
Try to process name as a definition, or as an URL if not found. |
InsertTag.TagHandler |
processAttribute(String name)
Process tag attribute "attribute". |
protected InsertTag.TagHandler |
processBean(String beanName,
String beanProperty,
String beanScope)
Process a bean. |
protected InsertTag.TagHandler |
processDefinition(ComponentDefinition definition)
End of Process tag attribute "definition". |
protected InsertTag.TagHandler |
processDefinitionName(String name)
Process tag attribute "definition". |
InsertTag.TagHandler |
processName(String name)
Process name. |
void |
processNestedTag(PutListTag nestedTag)
Process nested ≶putList> tag. |
void |
processNestedTag(PutTag nestedTag)
Process nested ≶put> tag. |
InsertTag.TagHandler |
processObjectValue(Object value)
Process an object retrieved as a bean or attribute. |
InsertTag.TagHandler |
processTypedAttribute(AttributeDefinition value)
Process typed attribute according to its type. |
InsertTag.TagHandler |
processUrl(String url)
Process the url. |
void |
putAttribute(PutListTag nestedTag)
Method calls by nested ≶putList> tags. |
void |
putAttribute(String name,
Object value)
Add a body attribute. |
void |
release()
Reset member values for reuse. |
protected void |
releaseInternal()
Reset internal member values for reuse. |
void |
setAttribute(String value)
Set attribute. |
void |
setBeanName(String value)
Set bean name. |
void |
setBeanProperty(String value)
Set bean property. |
void |
setBeanScope(String value)
Set bean scope. |
void |
setComponent(String name)
Set component. |
void |
setDefinition(String name)
Set definition. |
void |
setFlush(boolean flush)
Set flush. |
void |
setFlush(String flush)
Set flush. |
void |
setIgnore(boolean ignore)
Set ignore. |
void |
setName(String value)
Set name. |
void |
setPageContext(PageContext pc)
Set the current page context. |
static boolean |
userHasRole(HttpServletRequest request,
String role)
Parse the list of roles and return true or false based on whether
the user has that role or not. |
Methods inherited from class org.apache.struts.tiles.taglib.DefinitionTagSupport |
---|
getControllerName, getControllerType, getPage, getRole, getTemplate, setController, setControllerClass, setControllerName, setControllerType, setControllerUrl, setPage, setRole, setTemplate |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ROLE_DELIMITER
protected static Log log
protected boolean flush
protected String name
protected String attribute
protected String beanName
protected String beanProperty
protected String beanScope
protected boolean isErrorIgnored
protected String definitionName
protected boolean processEndTag
protected ComponentContext cachedCurrentContext
protected InsertTag.TagHandler tagHandler
protected PageContext pageContext
Constructor Detail |
---|
public InsertTag()
Method Detail |
---|
public void release()
release
in interface Tag
release
in class DefinitionTagSupport
protected void releaseInternal()
public void setPageContext(PageContext pc)
Needed to allow inner classes to access pageContext.
setPageContext
in interface Tag
setPageContext
in class TagSupport
public PageContext getPageContext()
public void setName(String value)
public String getName()
public void setComponent(String name)
public void setDefinition(String name)
public String getDefinitionName()
public void setAttribute(String value)
public void setBeanName(String value)
public String getBeanName()
public void setBeanProperty(String value)
public String getBeanProperty()
public void setBeanScope(String value)
public String getBeanScope()
public void setFlush(boolean flush)
public boolean getFlush()
public void setFlush(String flush)
public void setIgnore(boolean ignore)
public boolean getIgnore()
public void putAttribute(String name, Object value)
public void processNestedTag(PutTag nestedTag) throws JspException
processNestedTag
in interface PutTagParent
nestedTag
- Nested tag to process.
JspException
public void processNestedTag(PutListTag nestedTag) throws JspException
processNestedTag
in interface PutListTagParent
nestedTag
- Nested PutTag defining the attribute.
JspException
public void putAttribute(PutListTag nestedTag) throws JspException
JspException
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class TagSupport
JspException
public InsertTag.TagHandler createTagHandler() throws JspException
JspException
public InsertTag.TagHandler processObjectValue(Object value) throws JspException
JspException
- - Throws by underlying nested call to
processDefinitionName()public InsertTag.TagHandler processName(String name) throws JspException
JspException
- - Throws by underlying nested call to
processDefinitionName()public InsertTag.TagHandler processUrl(String url) throws JspException
JspException
- If failed to create controllerprotected InsertTag.TagHandler processDefinitionName(String name) throws JspException
name
- Name of the definition.
JspException-
- NoSuchDefinitionException No Definition found for name.
JspException-
- FactoryNotFoundException Can't find Definitions factory.
JspException-
- DefinedComponentFactoryException General error in factory.
JspException
- InstantiationException Can't create requested controllerprotected InsertTag.TagHandler processDefinition(ComponentDefinition definition) throws JspException
definition
- Definition to process.
JspException
- InstantiationException Can't create requested controllerprotected InsertTag.TagHandler processBean(String beanName, String beanProperty, String beanScope) throws JspException
beanName
- Name of the beanbeanProperty
- Property in the bean, or null.beanScope
- bean scope, or null.
JspException
- - NoSuchDefinitionException No value associated to bean.
JspException
- an error occur while reading bean, or no definition found.
JspException
- - Throws by underlying nested call to processDefinitionName()public InsertTag.TagHandler processAttribute(String name) throws JspException
name
- Name of the attribute.
JspException
- - NoSuchDefinitionException No Definition found for name.
JspException
- - Throws by underlying nested call to processDefinitionName()public InsertTag.TagHandler processAsDefinitionOrURL(String name) throws JspException
name
- Name to process.
JspException
- InstantiationException Can't create requested controllerpublic InsertTag.TagHandler processTypedAttribute(AttributeDefinition value) throws JspException
value
- Typed attribute to process.
JspException
- - Throws by underlying nested call to processDefinitionName()protected void doInclude(String page, boolean flush) throws ServletException, IOException
page
- The page that will be includedflush
- If the writer should be flushed before the include
ServletException
- - Thrown by call to pageContext.include()
IOException
- - Thrown by call to pageContext.include()public static boolean userHasRole(HttpServletRequest request, String role)
true
or false
based on whether
the user has that role or not.
role
- Comma-delimited list of roles.request
- The request.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |