|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.tag.layout.LayoutComponentRenderer
public class LayoutComponentRenderer
An object that can be stuffed into a scope (page, request, application, etc.) and render a layout component to a string. This allows for use of EL expressions to output a component (as described in the book Stripes ... and web development is fun again) without requiring that all components be evaluated and buffered just in case a string representation is needed. The evaluation happens only when necessary, saving cycles and memory.
When toString()
is called, the component renderer will evaluate the body of any
LayoutComponentTag
found in the stack of LayoutContext
s maintained in the JSP
PageContext
having the same name as that passed to the constructor. The page context must
be provided with a call to pushPageContext(PageContext)
for the renderer to work
correctly.
Constructor Summary | |
---|---|
LayoutComponentRenderer(String component)
Create a new instance to render the named component to a string. |
Method Summary | |
---|---|
String |
getCurrentPage()
Get the path to the currently executing JSP. |
PageContext |
getPageContext()
Get the last page context that was pushed onto the stack. |
PageContext |
popPageContext()
Pop the last page context off the stack and return it. |
void |
pushPageContext(PageContext pageContext)
Push a new page context onto the page context stack. |
String |
toString()
Open a buffer in LayoutWriter , call write() to render the component and then
return the buffer contents. |
boolean |
write()
Write the component to the page context's writer, optionally buffering the output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LayoutComponentRenderer(String component)
component
- The name of the component to render.Method Detail |
---|
public void pushPageContext(PageContext pageContext)
public PageContext popPageContext()
public PageContext getPageContext()
public String getCurrentPage()
public boolean write() throws ServletException, IOException
IOException
- If thrown by LayoutContext.doInclude(PageContext, String)
ServletException
- If thrown by LayoutContext.doInclude(PageContext, String)
public String toString()
LayoutWriter
, call write()
to render the component and then
return the buffer contents.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |