|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectorg.apache.struts2.components.Component
org.apache.struts2.components.Include
public class 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.
<-- 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
字段摘要 |
---|
从类 org.apache.struts2.components.Component 继承的字段 |
---|
COMPONENT_STACK |
构造方法摘要 | |
---|---|
Include(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
方法摘要 | |
---|---|
void |
addParameter(String key,
Object value)
Adds the given key and value to this component's own parameter. |
boolean |
end(Writer writer,
String body)
Callback for the end tag of this component. |
static String |
getContextRelativePath(javax.servlet.ServletRequest request,
String relativePath)
|
static void |
include(String relativePath,
Writer writer,
javax.servlet.ServletRequest request,
javax.servlet.http.HttpServletResponse response)
已过时。 use include(String, java.io.Writer, javax.servlet.ServletRequest,
javax.servlet.http.HttpServletResponse, String) instead with correct encoding specified |
static void |
include(String relativePath,
Writer writer,
javax.servlet.ServletRequest request,
javax.servlet.http.HttpServletResponse response,
String encoding)
Include a resource in a response. |
void |
setDefaultEncoding(String encoding)
|
void |
setValue(String value)
|
从类 org.apache.struts2.components.Component 继承的方法 |
---|
addAllParameters, altSyntax, copyParams, getComponentStack, getParameters, getStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, start, usesBody |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public Include(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
方法详细信息 |
---|
public void setDefaultEncoding(String encoding)
public boolean end(Writer writer, String body)
Component
复制的描述
Component
中的 end
writer
- the output writer.body
- the rendered body.
public void setValue(String value)
public static String getContextRelativePath(javax.servlet.ServletRequest request, String relativePath)
public void addParameter(String key, Object value)
Component
复制的描述
Component
中的 addParameter
key
- the key of the new parameter to add.value
- the value assoicated with the key.public static void include(String relativePath, Writer writer, javax.servlet.ServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
include(String, java.io.Writer, javax.servlet.ServletRequest,
javax.servlet.http.HttpServletResponse, String)
instead with correct encoding specified
javax.servlet.ServletException
IOException
public static void include(String relativePath, Writer writer, javax.servlet.ServletRequest request, javax.servlet.http.HttpServletResponse response, String encoding) throws javax.servlet.ServletException, IOException
relativePath
- the relative path of the resource to include; resolves to getContextRelativePath(javax.servlet.ServletRequest,
String)
writer
- the Writer to write output torequest
- the current requestresponse
- the response to write toencoding
- the file encoding to use for including the resource; if null, it will default to the
platform encoding
javax.servlet.ServletException
IOException
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |