com.opensymphony.webwork.components
Class Include

java.lang.Object
  extended by com.opensymphony.webwork.components.Component
      extended by com.opensymphony.webwork.components.Include

public class Include
extends Component

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 <ww:property...> tag!

Examples

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

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

 <-- Three: -->
 <ww:include value="myJsp.jsp">
    <ww:param name="param1">value1</ww:param>
    <ww:param name="param2">value2<ww:param>
 </ww: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
 
 

Since:
2.2
Version:
$Revision: 2676 $
Author:
Rickard Oberg (rickard@dreambean.com), Scott Farquhar, Rene Gielen, tm_jee, Rainer Hermanns

Field Summary
protected  String value
           
 
Fields inherited from class com.opensymphony.webwork.components.Component
COMPONENT_STACK, id, parameters, stack
 
Constructor Summary
Include(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res)
           
 
Method Summary
 void addParameter(String key, Object value)
          Add's the given key and value to this components own parameter.
 boolean end(Writer writer, String body)
          Callback for the end tag of this component.
static String getContextRelativePath(ServletRequest request, String relativePath)
           
static void include(String aResult, Writer writer, ServletRequest request, HttpServletResponse response)
           
 void setValue(String value)
          The jsp/servlet output to include
 
Methods inherited from class com.opensymphony.webwork.components.Component
addAllParameters, altSyntax, copyParams, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getComponentStack, getId, getParameters, getStack, popComponentStack, setId, start, toString, usesBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected String value
Constructor Detail

Include

public Include(OgnlValueStack stack,
               HttpServletRequest req,
               HttpServletResponse res)
Method Detail

end

public boolean end(Writer writer,
                   String body)
Description copied from class: Component
Callback for the end tag of this component. Should the body be evaluated again?

NOTE: will pop component stack.

Overrides:
end in class Component
Parameters:
writer - the output writer.
body - the rendered body.
Returns:
true if the body should be evaluated again

setValue

public void setValue(String value)
The jsp/servlet output to include


getContextRelativePath

public static String getContextRelativePath(ServletRequest request,
                                            String relativePath)

addParameter

public void addParameter(String key,
                         Object value)
Description copied from class: Component
Add's the given key and value to this components own parameter.

If the provided key is null nothing happends. If the provided value is null any existing parameter with the given key name is removed.

Overrides:
addParameter in class Component
Parameters:
key - the key of the new parameter to add.
value - the value assoicated with the key.

include

public static void include(String aResult,
                           Writer writer,
                           ServletRequest request,
                           HttpServletResponse response)
                    throws ServletException,
                           IOException
Throws:
ServletException
IOException

WebWork Project Page