Simple Controller
implementation that transforms the virtual
path of a URL into a view name and returns that view.
Can optionally prepend a prefix
and/or append a
suffix
to build the viewname from the URL filename.
Find below some examples:
"/index" -> "index"
"/index.html" -> "index"
"/index.html"
+ prefix "pre_"
and suffix "_suf" -> "pre_index_suf"
"/products/view.html" -> "products/view"
Thanks to David Barri for suggesting prefix/suffix support!
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.servlet.support.WebContentGenerator
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.context.support.ApplicationObjectSupport
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set the prefix to prepend to the request URL filename
to build a view name.
| |||||||||||
Set the suffix to append to the request URL filename
to build a view name.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Extract a URL path from the given request,
suitable for view name extraction.
| |||||||||||
Extract the URL filename from the given request URI.
| |||||||||||
Return the prefix to prepend to the request URL filename.
| |||||||||||
Return the suffix to append to the request URL filename.
| |||||||||||
Returns view name based on the URL filename,
with prefix/suffix applied when appropriate.
| |||||||||||
Returns view name based on the URL filename,
with prefix/suffix applied when appropriate.
| |||||||||||
Build the full view name based on the given view name
as indicated by the URL path.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.servlet.mvc.AbstractUrlViewController
| |||||||||||
From class
org.springframework.web.servlet.mvc.AbstractController
| |||||||||||
From class
org.springframework.web.servlet.support.WebContentGenerator
| |||||||||||
From class
org.springframework.web.context.support.WebApplicationObjectSupport
| |||||||||||
From class
org.springframework.context.support.ApplicationObjectSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.context.ApplicationContextAware
| |||||||||||
From interface
org.springframework.web.context.ServletContextAware
| |||||||||||
From interface
org.springframework.web.servlet.mvc.Controller
|
Set the prefix to prepend to the request URL filename to build a view name.
Set the suffix to append to the request URL filename to build a view name.
Extract a URL path from the given request, suitable for view name extraction.
request | current HTTP request |
---|
Extract the URL filename from the given request URI.
uri | the request URI; for example "/index.html" |
---|
"index"
Returns view name based on the URL filename, with prefix/suffix applied when appropriate.
request | current HTTP request |
---|
null
)Returns view name based on the URL filename, with prefix/suffix applied when appropriate.
uri | the request URI; for example "/index.html" |
---|
"index"
Build the full view name based on the given view name as indicated by the URL path.
The default implementation simply applies prefix and suffix. This can be overridden, for example, to manipulate upper case / lower case, etc.
viewName | the original view name, as indicated by the URL path |
---|