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

Spring MVC

 
karl czukoski
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to Spring and am attempting an example but am puzzled as to why a MultiActionController constuctor is not getting called after a link is clicked from a index.html welcome file. There are no errors from the server just The requested resource is not available.

web.xml


index.html



spring-servlet
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Maybe your mapping String is incorrect. Do you need to put @RequestMapping(value="/viewAll.view", method=RequestMethod.GET)

or somtimes just @RequestMapping(value="/viewAll", method=RequestMethod.GET)

I always forget if you have to have the leading "/"

On another note. If you are new to Spring and using the latest version. Having your controllers extend or implement a Spring Controller class or interface is not a best practice. In today's Spring your Controllers should just be POJOs. This makes your Controller less coupled to Spring.

Thanks

Mark
 
karl czukoski
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I attempted shifting to the @RequestMapping(value="/viewAll", method=RequestMethod.GET) without luck. Perhaps I am missing a file in the build path? Files are attached.
jar files.GIF
[Thumbnail for jar files.GIF]
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you also try

@RequestMapping(value="/viewAll.view", method=RequestMethod.GET)

It isn't an issue with jar files. If it was, you would get an exception.

Maybe there is an exception in your log file that isn't showing in your console.

Mark
 
karl czukoski
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, tried that, still no luck. Where/what log file contains the errors?
 
karl czukoski
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, the web.xml and dispatcher-servlet.xml were tucked in a folder under the WEB-INF so I moved directly under WEB-INF and all seems cool, for the time being. Still curious though on how to enable debug logging for solving errors.

Thanks
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramesh. Please don't resurrect an old thread. And just to self promote your own site. That breaks JavaRanch policies.

Mark
 
johnyy Doe
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your mapping is not correct. I found simple good example here:

Spring MVC Hello World

Many simple example: Spring MVC
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic