• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Spring MVC

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
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
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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
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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep, tried that, still no luck. Where/what log file contains the errors?
 
karl czukoski
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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
Ramesh. Please don't resurrect an old thread. And just to self promote your own site. That breaks JavaRanch policies.

Mark
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic