wood burning stoves 2.0*
The moose likes Spring and the fly likes Spring MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring MVC" Watch "Spring MVC" New topic
Author

Spring MVC

karl czukoski
Greenhorn

Joined: Dec 30, 2010
Posts: 22
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

Joined: Feb 05, 2001
Posts: 17260
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
karl czukoski
Greenhorn

Joined: Dec 30, 2010
Posts: 22
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.


[Thumbnail for jar files.GIF]

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

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

Joined: Dec 30, 2010
Posts: 22
Yep, tried that, still no luck. Where/what log file contains the errors?
karl czukoski
Greenhorn

Joined: Dec 30, 2010
Posts: 22
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

Joined: Feb 05, 2001
Posts: 17260
    
    6

Ramesh. Please don't resurrect an old thread. And just to self promote your own site. That breaks JavaRanch policies.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring MVC