|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.xconf.toolbox.spring.mvc.RedirectViewResolver
public class RedirectViewResolver
A ViewResolver implementation that maps view names to redirect URLs. This class is useful if you want to avoid programmatically creating Spring RedirectViews within your controller classes. You can always use the Spring ResourceBundleViewResolver to mix multiple view types, but this provides a nice alternative if all you would use the resource bundle is to map view names to either redirects or some other view technologies without any localisation.
All you need to do is to set the order property of this class so that the DispatchServlet uses this class before any of your other ViewResolvers.
| Field Summary |
|---|
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
RedirectViewResolver()
|
|
| Method Summary | |
|---|---|
int |
getOrder()
|
View |
resolveViewName(String viewName,
Locale locale)
Returns the configured RedirectView, or null if no view is found for the name. |
void |
setAppendModelParams(boolean appendModelParams)
Set whether to return a RedirectView that appends model parameters
to the query string (true by default). |
void |
setContextRelative(boolean contextRelative)
Set whether to interpret the given URL as relative to the current ServletContext ( false by default). |
void |
setHttp10Compatible(boolean http10Compatible)
Set whether to stay compatible with HTTP 1.0 clients ( true by default). |
void |
setOrder(int order)
|
void |
setViews(Properties views)
Set view name / redirect URL pairs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RedirectViewResolver()
| Method Detail |
|---|
public int getOrder()
getOrder in interface Orderedpublic void setOrder(int order)
public void setViews(Properties views)
public void setContextRelative(boolean contextRelative)
false by default).
public void setHttp10Compatible(boolean http10Compatible)
true by default).
public void setAppendModelParams(boolean appendModelParams)
RedirectView that appends model parameters
to the query string (true by default).
public View resolveViewName(String viewName,
Locale locale)
throws Exception
RedirectView, or null if no view is found for the name.
resolveViewName in interface ViewResolverException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||