org.apache.struts2.dispatcher
类 PlainTextResult
java.lang.Object
org.apache.struts2.dispatcher.StrutsResultSupport
org.apache.struts2.dispatcher.PlainTextResult
- 所有已实现的接口:
- com.opensymphony.xwork2.Result, Serializable, StrutsStatics
public class PlainTextResult
- extends StrutsResultSupport
A result that send the content out as plain text. Useful typically when needed
to display the raw content of a JSP or Html file for example.
- location (default) = location of the file (jsp/html) to be displayed as plain text.
- charSet (optional) = character set to be used. This character set will be used to set the
response type (eg. Content-Type=text/plain; charset=UTF-8) and when reading
using a Reader. Some example of charSet would be UTF-8, ISO-8859-1 etc.
<action name="displayJspRawContent" >
<result type="plainText">/myJspFile.jsp</result>
</action>
<action name="displayJspRawContent" >
<result type="plainText">
<param name="location">/myJspFile.jsp</param>
<param name="charSet">UTF-8</param>
</result>
</action>
- 另请参见:
- 序列化表格
BUFFER_SIZE
public static final int BUFFER_SIZE
- 另请参见:
- 常量字段值
PlainTextResult
public PlainTextResult()
PlainTextResult
public PlainTextResult(String location)
getCharSet
public String getCharSet()
- Set the character set
- 返回:
- The character set
setCharSet
public void setCharSet(String charSet)
- Set the character set
- 参数:
charSet
- The character set