Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

View resolver is not able to identify the correct view

 
samir ware
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic