public class DefaultContentTypeHandlerManager extends Object implements ContentTypeHandlerManager
ContentTypeHandler
instances and uses them to
process resultsSTRUTS_REST_HANDLER_OVERRIDE_PREFIX
Constructor and Description |
---|
DefaultContentTypeHandlerManager() |
Modifier and Type | Method and Description |
---|---|
String |
findExtension(String url)
Finds the extension in the url
|
String |
getExtensionIfPresent(String url)
Gets the extension in the url
|
ContentTypeHandler |
getHandlerForRequest(javax.servlet.http.HttpServletRequest request)
Gets the handler for the request by looking at the request content type and extension
|
ContentTypeHandler |
getHandlerForResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse res)
Gets the handler for the response by looking at the extension of the request
|
String |
handleResult(ActionConfig actionConfig,
Object methodResult,
Object target)
Handles the result using handlers to generate content type-specific content
|
String |
handleResult(ActionInvocation invocation,
Object methodResult,
Object target)
Handles the result using handlers to generate content type-specific content
|
protected String |
readResultCode(Object methodResult) |
protected Integer |
readStatusCode(Object methodResult) |
void |
setContainer(Container container) |
void |
setDefaultExtension(String name) |
public void setDefaultExtension(String name)
public void setContainer(Container container)
public ContentTypeHandler getHandlerForRequest(javax.servlet.http.HttpServletRequest request)
getHandlerForRequest
in interface ContentTypeHandlerManager
request
- The requestpublic ContentTypeHandler getHandlerForResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse res)
getHandlerForResponse
in interface ContentTypeHandlerManager
request
- The requestres
- The servlet responsepublic String handleResult(ActionConfig actionConfig, Object methodResult, Object target) throws IOException
ContentTypeHandlerManager
handleResult
in interface ContentTypeHandlerManager
actionConfig
- The action config for the current requestmethodResult
- The object returned from the action methodtarget
- The object to return, usually the action objectIOException
- If unable to write to the responsepublic String handleResult(ActionInvocation invocation, Object methodResult, Object target) throws IOException
handleResult
in interface ContentTypeHandlerManager
invocation
- The action invocation for the current requestmethodResult
- The object returned from the action methodtarget
- The object to return, usually the action objectIOException
- If unable to write to the responsepublic String getExtensionIfPresent(String url)
url
- The urlpublic String findExtension(String url)
findExtension
in interface ContentTypeHandlerManager
url
- The urlCopyright © 2000–2020 Apache Software Foundation. All rights reserved.