File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Page hyperlink navigation with Spring MVC @Controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Page hyperlink navigation with Spring MVC @Controller" Watch "Page hyperlink navigation with Spring MVC @Controller" New topic
Author

Page hyperlink navigation with Spring MVC @Controller

james loveay
Greenhorn

Joined: Apr 24, 2012
Posts: 10

Hi all,

I've been working on this for a while but can't seem to find the right way to go with it.

I want to be able to log in to a system, then on clicking on a hyperlink go to another page which will display a list of objects.

I'm using Spring MVC 3.1 with @Controller classes and the navigation goes from one .jsp to another .jsp page.

I've tried a few things and have considered SWF but think that is a little over what I need to do for this, also there seems to be no examples that I have been able to find, unless I'm getting a search term wrong.

So this is the code that I have



MainMenuController File



I have tried the @RequestMapping("/loanbooks") also @RequestMapping(value = "/loanbooks", method = RequestMethod.GET)

Both have failed, either returning a 404 or returning a mapping issue, if I can get the mapping correct between the jsp and the controller and there is still a problem then I think that I require a mapping in the xml file but I'm just not sure where I'm going wrong.

Can somebody take the time to have a look at this and explain what I'm missing.

Many thanks in advance.

I think though that I'll try to use SWF and see how I go with that, hopefully I can make another post soon to let you know how I got on with it.
james loveay
Greenhorn

Joined: Apr 24, 2012
Posts: 10

Hi all,

just an update, Have solved the problem.

Again another simple one that I just couldn't figure out and stumbled on it just by luck but I know what I did so that's great for later.

Just wanted to input the code changes so that anybody with the same problem can follow and not go around the houses like I have been.



The controller class was changed



This solved the problem and allowed my to display the results quite happily.
 
Don't get me started about those stupid light bulbs.
 
subject: Page hyperlink navigation with Spring MVC @Controller