• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tiles view and Json view independently

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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 com.ibm.ws.webcontainer.servlet.ServletWrapper 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(TilesView.java:104)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:212)



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.

thanks,
Pons
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Mark
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic