• 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

View resolver is not able to identify the correct view

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all
My entry for view resolver in config file is as follows.



And my request URL is as follows



My request gets mapped to the correct controller. Though from controller I am not able to locate the accurate view.
My handleRequest code from controller is as follows




Though after controller gets invoked I am getting following error .



where as the expected URL is




Am I missing something here ? Why my view provided in the controller is not getting picked up ?
Any white paper / link will greatly be appreciated.
Thanks in advance
Samir
 
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
Why do you have

<property name="viewClass" value="org.springframework.web.servlet.view.JstlVi ew"/>

in your internalResourceViewResolver?

Also why do you need…

@RequestMapping(method = { RequestMethod.GET, RequestMethod.POST })?

On your method. For all web browsers they submit either GETs or POSTs anyway, so it is redundant.

Finally, it looks like you are using the older Spring 2.0 and before Controller interfaces rather than the more up to date approach of making your Controller's POJOs and not implementing a Spring interface or extending a Spring class.

Is this code that was already there??? It looks more like you are learning Spring now, and using dated materials to learn.

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic