Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using <mvc:view-controller> for tiles

 
sunny sand
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Yes. For example:


2. All you need is make sure you have tiles definitions + dispatcher-servlet.xml configured correctly.
 
sunny sand
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you look at below to see?



and Chaining ViewResolvers from the doc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic