Save This Page
Home » struts-2.1.8.1-src » org.apache » struts2 » components » [javadoc | source]
org.apache.struts2.components
public class: Include [javadoc | source]
java.lang.Object
   org.apache.struts2.components.Component
      org.apache.struts2.components.Include

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.

Examples


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

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

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



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
Constructor:
 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)