|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.riotfamily.pages.view.SiteRequestToViewNameTranslator
public class SiteRequestToViewNameTranslator
Copy of Spring's DefaultRequestToViewNameTranslator that strips
the site prefix (if present).
| Constructor Summary | |
|---|---|
SiteRequestToViewNameTranslator()
|
|
| Method Summary | |
|---|---|
String |
getViewName(HttpServletRequest request)
Translates the request URI of the incoming HttpServletRequest
into the view name based on the configured parameters. |
void |
setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use the full path within the current servlet context. |
void |
setPrefix(String prefix)
Set the prefix to prepend to generated view names. |
void |
setSeparator(String separator)
Set the value that will replace ' /' as the separator
in the view name. |
void |
setStripExtension(boolean stripExtension)
Set whether or not file extensions should be stripped from the URI when generating the view name. |
void |
setStripLeadingSlash(boolean stripLeadingSlash)
Set whether or not leading slashes should be stripped from the URI when generating the view name. |
void |
setStripSitePrefix(boolean stripSitePrefix)
Set whether or not the site prefix should be stripped. |
void |
setSuffix(String suffix)
Set the suffix to append to generated view names. |
void |
setUrlDecode(boolean urlDecode)
Set if the context path and request URI should be URL-decoded. |
void |
setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for
the resolution of lookup paths. |
protected String |
transformPath(String lookupPath,
HttpServletRequest request)
Transform the request URI (in the context of the webapp) stripping slashes and extensions, and replacing the separator as required. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SiteRequestToViewNameTranslator()
| Method Detail |
|---|
public void setPrefix(String prefix)
prefix - the prefix to prepend to generated view namespublic void setSuffix(String suffix)
suffix - the suffix to append to generated view namespublic void setSeparator(String separator)
/' as the separator
in the view name. The default behavior simply leaves '/'
as the separator.
separator - the desired separator valuepublic void setStripLeadingSlash(boolean stripLeadingSlash)
stripLeadingSlash - true if leading slashes are to be strippedpublic void setStripExtension(boolean stripExtension)
stripExtension - true if file extensions should be strippedpublic void setStripSitePrefix(boolean stripSitePrefix)
stripSitePrefix - true if the site prefix should be strippedpublic void setAlwaysUseFullPath(boolean alwaysUseFullPath)
alwaysUseFullPath - true if URL lookup should always use the full pathUrlPathHelper.setAlwaysUseFullPath(boolean)public void setUrlDecode(boolean urlDecode)
Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).
UrlPathHelper.setUrlDecode(boolean)public void setUrlPathHelper(UrlPathHelper urlPathHelper)
UrlPathHelper to use for
the resolution of lookup paths.
Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple web components.
urlPathHelper - the desired helper
IllegalArgumentException - if the supplied UrlPathHelper is nullpublic String getViewName(HttpServletRequest request)
HttpServletRequest
into the view name based on the configured parameters.
getViewName in interface RequestToViewNameTranslatorUrlPathHelper.getLookupPathForRequest(javax.servlet.http.HttpServletRequest),
transformPath(java.lang.String, javax.servlet.http.HttpServletRequest)
protected String transformPath(String lookupPath,
HttpServletRequest request)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||