Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.dispatcher
Class PlainTextResult

    java.lang.Object
      org.apache.struts2.dispatcher.StrutsResultSupport
          org.apache.struts2.dispatcher.PlainTextResult

All Implemented Interfaces:
  Result, Serializable, StrutsStatics

    public class PlainTextResult

extends StrutsResultSupport

A result that send the content out as plain text. Usefull 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>

See Also:
  Serialized Form

Field Summary
`private static Log` | `_log`
`static int` | `BUFFER_SIZE`
`private String` | `charSet`
`private static long` | `serialVersionUID`

Fields inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
`DEFAULT_PARAM`

Fields inherited from interface org.apache.struts2.StrutsStatics
`HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_PORTLET_CONTEXT`

Constructor Summary
`PlainTextResult()`
`PlainTextResult(String location)`

Method Summary
`protected void` | `doExecute(String finalLocation, ActionInvocation invocation)` Executes the result given a final location (jsp page, action, etc) and the action invocation (the state in which the action was executed).
`String` | `getCharSet()` Set the character set
`void` | `setCharSet(String charSet)` Set the character set

Methods inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
`conditionalParse, execute, getLastFinalLocation, setEncode, setLocation, setParse`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BUFFER_SIZE

    public static final int BUFFER_SIZE

See Also:
  Constant Field Values

### _log

    private static final Log _log

### serialVersionUID

    private static final long serialVersionUID

See Also:
  Constant Field Values

### charSet

    private String charSet

Constructor Detail

### PlainTextResult

    public PlainTextResult()

### PlainTextResult

    public PlainTextResult(String location)

Method Detail

### getCharSet

    public String getCharSet()

  Set the character set

  Returns:
    The character set

### setCharSet

    public void setCharSet(String charSet)

  Set the character set

  Parameters:
    `charSet` - The character set

### doExecute

    protected void doExecute(String finalLocation,
                             ActionInvocation invocation)
                      throws Exception

  Description copied from class: `StrutsResultSupport`
  Executes the result given a final location (jsp page, action, etc) and the action invocation (the state in which the action was executed). Subclasses must implement this class to handle custom logic for result handling.

  Specified by:
    `doExecute` in class `StrutsResultSupport`
  Parameters:
    `finalLocation` - the location (jsp page, action, etc) to go to.
    `invocation` - the execution state of the action.
  Throws:
    `Exception` - if an error occurs while executing the result.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.