|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractCachingViewResolver
org.riotfamily.common.web.view.SuffixViewResolver
public class SuffixViewResolver
View resolver that supports view names with a suffix. For example someView.jsp would be delegated to the ViewResolver registered for the jsp suffix.
Field Summary | |
---|---|
static String |
FORWARD_URL_PREFIX
Prefix for special view names that specify a forward URL (usually to a controller after a form has been submitted and processed). |
static String |
REDIRECT_URL_PREFIX
Prefix for special view names that specify a redirect URL (usually to a controller after a form has been submitted and processed). |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
SuffixViewResolver()
|
Method Summary | |
---|---|
int |
getOrder()
Return the order in which this ViewResolver
is evaluated. |
protected View |
loadView(String viewName,
Locale locale)
|
void |
setDefaultSuffix(String defaultSuffix)
Sets a default suffix that will be appended to view names that don't contain a dot. |
void |
setOrder(int order)
Set the order in which this ViewResolver
is evaluated. |
void |
setRedirectContextRelative(boolean redirectContextRelative)
Set whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. as relative to the web application root. |
void |
setRedirectHttp10Compatible(boolean redirectHttp10Compatible)
Set whether redirects should stay compatible with HTTP 1.0 clients. |
void |
setResolvers(Map<String,ViewResolver> resolvers)
|
Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver |
---|
clearCache, createView, getCacheKey, isCache, removeFromCache, resolveViewName, setCache |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
---|
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REDIRECT_URL_PREFIX
public static final String FORWARD_URL_PREFIX
Constructor Detail |
---|
public SuffixViewResolver()
Method Detail |
---|
public void setResolvers(Map<String,ViewResolver> resolvers)
resolvers
- ViewResolvers keyed by suffix (without dots).public void setDefaultSuffix(String defaultSuffix)
null
(default), view names without
an extension won't be resolved which allows resolver chaining.
public void setRedirectContextRelative(boolean redirectContextRelative)
Default is "true": A redirect URL that starts with a slash will be interpreted as relative to the web application root, i.e. the context path will be prepended to the URL.
Redirect URLs can be specified via the "redirect:" prefix. E.g.: "redirect:myAction.do"
RedirectView.setContextRelative(boolean)
,
REDIRECT_URL_PREFIX
public void setRedirectHttp10Compatible(boolean redirectHttp10Compatible)
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.
Redirect URLs can be specified via the "redirect:" prefix. E.g.: "redirect:myAction.do"
RedirectView.setHttp10Compatible(boolean)
,
REDIRECT_URL_PREFIX
public void setOrder(int order)
ViewResolver
is evaluated. Default is Ordered.LOWEST_PRECEDENCE
.
public int getOrder()
ViewResolver
is evaluated.
getOrder
in interface Ordered
protected View loadView(String viewName, Locale locale) throws Exception
loadView
in class AbstractCachingViewResolver
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |