|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.common.web.controller.RedirectController
public class RedirectController
Controller that sends a redirect to a configurable URL.
Constructor Summary | |
---|---|
protected |
RedirectController()
|
|
RedirectController(String url)
|
|
RedirectController(String url,
boolean addContextPath,
boolean addServletMapping)
|
Method Summary | |
---|---|
protected void |
appendParameters(StringBuffer targetUrl,
HttpServletRequest request)
|
protected String |
getDestination(HttpServletRequest request)
|
ModelAndView |
handleRequest(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
sendRedirect(HttpServletRequest request,
HttpServletResponse response,
String targetUrl)
Send a redirect back to the HTTP client |
void |
setAddContextPath(boolean contextRelative)
|
void |
setAddServletMapping(boolean addServletMapping)
|
void |
setEncodingScheme(String encodingScheme)
Set the encoding to be used for parameter values. |
void |
setHttp10Compatible(boolean http10Compatible)
Set whether to stay compatible with HTTP 1.0 clients. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RedirectController(String url)
public RedirectController(String url, boolean addContextPath, boolean addServletMapping)
protected RedirectController()
Method Detail |
---|
public void setHttp10Compatible(boolean http10Compatible)
In the default implementation, this will enforce HTTP status code 302
in any case, i.e. delegate to HttpServletResponse.sendRedirect
.
Turning this off will send HTTP status code 303, which is the correct
code for HTTP 1.1 clients, but not understood by HTTP 1.0 clients.
Many HTTP 1.1 clients treat 302 just like 303, not making any difference. However, some clients depend on 303 when redirecting after a POST request; turn this flag off in such a scenario.
HttpServletResponse.sendRedirect(java.lang.String)
public void setAddContextPath(boolean contextRelative)
public void setAddServletMapping(boolean addServletMapping)
public void setEncodingScheme(String encodingScheme)
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception
handleRequest
in interface Controller
Exception
protected String getDestination(HttpServletRequest request)
protected void appendParameters(StringBuffer targetUrl, HttpServletRequest request) throws UnsupportedEncodingException
UnsupportedEncodingException
protected void sendRedirect(HttpServletRequest request, HttpServletResponse response, String targetUrl) throws IOException
request
- current HTTP request (allows for reacting to request method)response
- current HTTP response (for sending response headers)targetUrl
- the target URL to redirect to
IOException
- if thrown by response methods
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |