org.apache.struts2.rest.handler
Class HtmlHandler

java.lang.Object
  extended by org.apache.struts2.rest.handler.HtmlHandler
All Implemented Interfaces:
ContentTypeHandler

public class HtmlHandler
extends java.lang.Object
implements ContentTypeHandler

Handles HTML content, usually just a simple passthrough to the framework


Constructor Summary
HtmlHandler()
           
 
Method Summary
 java.lang.String fromObject(java.lang.Object obj, java.lang.String resultCode, java.io.Writer out)
          Writes content to the stream
 java.lang.String getContentType()
          Gets the content type for this handler
 java.lang.String getExtension()
          Gets the extension this handler supports
 void toObject(java.io.Reader in, java.lang.Object target)
          Populates an object using data from the input stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlHandler

public HtmlHandler()
Method Detail

fromObject

public java.lang.String fromObject(java.lang.Object obj,
                                   java.lang.String resultCode,
                                   java.io.Writer out)
                            throws java.io.IOException
Description copied from interface: ContentTypeHandler
Writes content to the stream

Specified by:
fromObject in interface ContentTypeHandler
Parameters:
obj - The object to write to the stream, usually the Action class
resultCode - The original result code
out - The output stream, usually the response
Returns:
The new result code
Throws:
java.io.IOException - If unable to write to the output stream

toObject

public void toObject(java.io.Reader in,
                     java.lang.Object target)
Description copied from interface: ContentTypeHandler
Populates an object using data from the input stream

Specified by:
toObject in interface ContentTypeHandler
Parameters:
in - The input stream, usually the body of the request
target - The target, usually the action class

getExtension

public java.lang.String getExtension()
Description copied from interface: ContentTypeHandler
Gets the extension this handler supports

Specified by:
getExtension in interface ContentTypeHandler
Returns:
The extension

getContentType

public java.lang.String getContentType()
Description copied from interface: ContentTypeHandler
Gets the content type for this handler

Specified by:
getContentType in interface ContentTypeHandler
Returns:
The mime type


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