wood burning stoves*
The moose likes Spring and the fly likes Using <mvc:view-controller> for tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Using <mvc:view-controller> for tiles" Watch "Using <mvc:view-controller> for tiles" New topic
Author

Using <mvc:view-controller> for tiles

sunny sand
Greenhorn

Joined: Mar 30, 2013
Posts: 4
Can we use mvc:view-controller tag for displaying a tiles view.
Eg:If we have a tiles definition of the form <definition name="userLogon.page" template="webapp/app/layout/baseLayoutExterior.jsp" extends="basePageDefinition">
Can we write <mvc:view-controller path="/logon" view-name="userLogon.page"/> in our servlet.xml file.
I am getting an HTTP 404 RESOURCE NOT FOUND ERROR on this whereas a normal hello.jsp page is displayed without problems.
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 394
1. Yes. For example:


2. All you need is make sure you have tiles definitions + dispatcher-servlet.xml configured correctly.
sunny sand
Greenhorn

Joined: Mar 30, 2013
Posts: 4
Hey thanks paul.One more thing,how can I configure a bean in dispatcher-servlet.xml so that it resolves both tiles views as well as jsp views.We have tilesViewResolver and tilesConfigurer for tiles whereas UrlBasedViewResolver for simple mapping to jsps. Could I combine these two into one bean.
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 394
Have you look at below to see?



and Chaining ViewResolvers from the doc.
 
 
subject: Using <mvc:view-controller> for tiles
 
Similar Threads
Getting (Restful) Path Parameters in Spring MVC 3
Problem finding index page under WEB-INF / Spring MVC
can't find css, images and js static files
Spring MVC and access to static html files
window.open()