|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.tag.layout.LayoutContext
public class LayoutContext
Used to move contextual information about a layout rendering between a LayoutRenderTag and a LayoutDefinitionTag. Holds the set of overridden components and any parameters provided to the render tag.
Field Summary | |
---|---|
static String |
BROKEN_INCLUDE_KEY
The attribute name by which the indicator of broken include functionality in the application server can be found in the application scope. |
static String |
LAYOUT_CONTEXT_KEY
The attribute name by which the stack of layout contexts can be found in the request. |
Constructor Summary | |
---|---|
LayoutContext(LayoutRenderTag renderTag)
A new context may be created only by a LayoutRenderTag . |
Method Summary | |
---|---|
void |
doInclude(PageContext pageContext,
String relativeUrlPath)
Called when a layout tag needs to execute a page in order to execute another layout tag. |
protected void |
doIncludeHack(PageContext pageContext,
String relativeUrlPath)
An alternative to PageContext.include(String, boolean) that works around broken
include functionality in certain application servers, including several current and recent
releases of WebLogic. |
String |
getComponent()
Get the name of the component to be rendered during the current phase of execution. |
LayoutRenderTagPath |
getComponentPath()
Get the list of components in the render page that must execute so that the render tag that created this context can execute. |
Map<String,LayoutComponentRenderer> |
getComponents()
Gets the Map of overridden components. |
String |
getDefinitionPage()
Get the path to the page that contains the LayoutDefinitionTag referenced by the render tag. |
LayoutContext |
getFirst()
Get the first context in the list. |
LayoutContext |
getLast()
Get the last context in the list. |
LayoutContext |
getNext()
Get the next layout context from the stack. |
LayoutWriter |
getOut()
Get the layout writer to which the layout is rendered. |
Map<String,Object> |
getParameters()
Gets the Map of parameters. |
LayoutContext |
getPrevious()
Get the previous layout context from the stack. |
String |
getRenderPage()
Get the path to the page that contains the LayoutRenderTag that created this context. |
LayoutRenderTag |
getRenderTag()
Get the render tag that created this context. |
boolean |
isComponentRenderPhase()
True if the intention of the current page execution is solely to render a component. |
protected boolean |
isIncludeBroken(PageContext pageContext)
Returns true if the current thread is executing in an application server that is known to have issues with doing normal includes using PageContext.include(String, boolean) . |
boolean |
isRendered()
Returns true if the layout has been rendered, false otherwise. |
static LayoutContext |
lookup(PageContext pageContext)
Look up the current layout context in a JSP page context. |
static LayoutContext |
pop(PageContext pageContext)
Remove the current layout context from the stack of layout contexts. |
static LayoutContext |
push(LayoutRenderTag renderTag)
Create a new layout context for the given render tag and push it onto the stack of layout contexts in a JSP page context. |
void |
setComponent(String component)
Set the name of the component to be rendered during the current phase of execution. |
void |
setComponentRenderPhase(boolean b)
Set the flag that indicates that the coming execution phase is solely to render a component. |
void |
setNext(LayoutContext next)
Set the next layout context in the stack. |
void |
setRendered(boolean rendered)
False initially, should be set to true when the layout is actually rendered. |
String |
toString()
To String implementation the parameters, and the component names. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String LAYOUT_CONTEXT_KEY
public static final String BROKEN_INCLUDE_KEY
Constructor Detail |
---|
public LayoutContext(LayoutRenderTag renderTag)
LayoutRenderTag
. The tag provides all the
information necessary to initialize the context.
renderTag
- The tag that is beginning a new layout render process.Method Detail |
---|
public static LayoutContext push(LayoutRenderTag renderTag)
public static LayoutContext lookup(PageContext pageContext)
pageContext
- The JSP page context to search for the layout context stack.public static LayoutContext pop(PageContext pageContext)
pageContext
- The JSP page context to search for the layout context stack.
public LayoutContext getPrevious()
public LayoutContext getNext()
public void setNext(LayoutContext next)
public LayoutContext getFirst()
public LayoutContext getLast()
public void doInclude(PageContext pageContext, String relativeUrlPath) throws ServletException, IOException
Called when a layout tag needs to execute a page in order to execute another layout tag.
Special handling is implemented to ensure the included page is aware of the current layout
context while also ensuring that pages included by other means (e.g., jsp:include
or
c:import
) are not aware of the current layout context.
This method calls PageContext.include(String, boolean)
with false
as the
second parameter so that the response is not flushed before the include request executes.
ServletException
IOException
protected boolean isIncludeBroken(PageContext pageContext)
PageContext.include(String, boolean)
.
protected void doIncludeHack(PageContext pageContext, String relativeUrlPath) throws ServletException, IOException
PageContext.include(String, boolean)
that works around broken
include functionality in certain application servers, including several current and recent
releases of WebLogic.
ServletException
IOException
public LayoutRenderTag getRenderTag()
public Map<String,LayoutComponentRenderer> getComponents()
public Map<String,Object> getParameters()
public boolean isRendered()
public void setRendered(boolean rendered)
public String getRenderPage()
LayoutRenderTag
that created this context.
public String getDefinitionPage()
LayoutDefinitionTag
referenced by the render tag.
public boolean isComponentRenderPhase()
public void setComponentRenderPhase(boolean b)
public String getComponent()
public void setComponent(String component)
public LayoutRenderTagPath getComponentPath()
public LayoutWriter getOut()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |