Save This Page
Home » struts- » org.apache » struts2 » components » [javadoc | source]
public class: Include [javadoc | source]

Include a servlet's output (result of servlet or a JSP page).

Note: Any additional params supplied to the included page are not accessible within the rendered page through the <s:property...> tag since no valuestack will be created. You can, however, access them in a servlet via the HttpServletRequest object or from a JSP page via a scriptlet.


<-- One: -->
<s:include value="myJsp.jsp" />

<-- Two: -->
<s:include value="myJsp.jsp">
   <s:param name="param1" value="value2" />
   <s:param name="param2" value="value2" />

<-- Three: -->
<s:include value="myJsp.jsp">
   <s:param name="param1">value1</s:param>
   <s:param name="param2">value2</s:param>

Example one - do an include myJsp.jsp page
Example two - do an include to myJsp.jsp page with parameters param1=value1 and param2=value2
Example three - do an include to myJsp.jsp page with parameters param1=value1 and param2=value2

Nested Class Summary:
static final class  Include.PageOutputStream  Implementation of ServletOutputStream that stores all data written to it in a temporary buffer accessible from {@link #getBuffer()} . 
static final class  Include.PageResponse  Simple wrapper to HTTPServletResponse that will allow getWriter() and getResponse() to be called as many times as needed without causing conflicts.

The underlying outputStream is a wrapper around {@link PageOutputStream} which will store the written content to a buffer.

This buffer can later be retrieved by calling {@link #getContent}. 

Field Summary
protected  String value     
Fields inherited from org.apache.struts2.components.Component:
COMPONENT_STACK,  stack,  parameters,  actionMapper,  throwExceptionOnELFailure
 public Include(ValueStack stack,
    HttpServletRequest req,
    HttpServletResponse res) 
Method from org.apache.struts2.components.Include Summary:
addParameter,   end,   getContextRelativePath,   include,   setDefaultEncoding,   setValue
Methods from org.apache.struts2.components.Component:
addAllParameters,   addParameter,   altSyntax,   altSyntax,   completeExpressionIfAltSyntax,   copyParams,   determineActionURL,   determineNamespace,   end,   end,   fieldError,   findAncestor,   findString,   findString,   findStringIfAltSyntax,   findValue,   findValue,   findValue,   getComponentStack,   getParameters,   getStack,   popComponentStack,   setActionMapper,   setThrowExceptionsOnELFailure,   start,   stripExpressionIfAltSyntax,   stripExpressionIfAltSyntax,   toString,   usesBody
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.components.Include Detail:
 public  void addParameter(String key,
    Object value) 
 public boolean end(Writer writer,
    String body) 
 public static String getContextRelativePath(ServletRequest request,
    String relativePath) 
 public static  void include(String aResult,
    Writer writer,
    ServletRequest request,
    HttpServletResponse response) throws ServletException, IOException 
 public  void setDefaultEncoding(String encoding) 
 public  void setValue(String value)