spring-framework / org.springframework.web.servlet.mvc / UrlFilenameViewController / <init>

<init>

UrlFilenameViewController()

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 some examples below:

  1. "/index" -> "index"
  2. "/index.html" -> "index"
  3. "/index.html" + prefix "pre_" and suffix "_suf" -> "pre_index_suf"
  4. "/products/view.html" -> "products/view"

Thanks to David Barri for suggesting prefix/suffix support!

Author
Alef Arendsen

Author
Juergen Hoeller

Author
Rob Harrop

See Also
#setPrefix#setSuffix