File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Tiles view and Json view independently Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Tiles view and Json view independently" Watch "Tiles view and Json view independently" New topic

Tiles view and Json view independently

Ponnusamy Gov

Joined: Feb 01, 2011
Posts: 18

Dear All,

I am using tiles view and json view for viewing purpose in spring framework 2.5.6. But in some application servers i am getting below error.
0000007b servlet E service SRVE0068E: Uncaught exception created in one of the service methods of the servlet corporateuser in application corpuser_2404_war. Exception created : javax.servlet.ServletException: No Tiles definition found for name 'jsonView'
at org.springframework.web.servlet.view.tiles.TilesView.prepareForRendering(
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(

Code to specify the json view:

xml configuration for json view:

Any one have any idea why this tiles error is coming since two views are configured properly.

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Simply because you are passing the "String" in the ModelAndView that the ViewResolver uses to resolve the view. It is most likely being resolved by the Tiles Configurer/View Resolver and not by the File one in your configuration. Basically all view resolvers will get the string your return, and the first one to say something wins, so in your case the Tiles one gets it first.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Sudhir Ravindra

Joined: May 31, 2010
Posts: 16
Your controller has already done the work of writing the json into the response. You need to return null from the controller to ensure that spring mvc does not forward further to a view.
I agree. Here's the link:
subject: Tiles view and Json view independently
It's not a secret anymore!