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 Spring 3 Newbie Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring 3 Newbie Question" Watch "Spring 3 Newbie Question" New topic
Author

Spring 3 Newbie Question

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
I have a JSP where I have defined a <FORM> tag with an input text field and a button to "Search".
So, when I click Submit, I see in the URL: " http://localhost:8080/MyApp/search".

In the controller for this JSP, I set up a @RequestMapping(value = "/search")
Then I have other code to do MAV actions.

-----

The problem is that when I submit the JSP, although the URL in the browser reads: http://localhost:8080/MyApp/search, I am getting the message that the "Request Sent by the Client is syntactically incorrect."

Am I missing something about how to map the JSP to the Controller in Spring 3?

I also tried having something like (method="POST") in the controller method, but that didn't work either.

Thanks in advance for any suggestions.

- Mike
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I am assuming you have your web.xml DispatcherServlet mapped to MyApp/*?

When you deploy your applicaiton, what does it show in the logs for mapped URLs, it will log out what it has mapped and see if your localhost:8080/MyApp/search is truly mapped.

You might not need the "/" in front of "search" in your @RequestMapping. I always have issues where I have a "/" in front or not.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
Mark Spritzler wrote:I am assuming you have your web.xml DispatcherServlet mapped to MyApp/*?

When you deploy your applicaiton, what does it show in the logs for mapped URLs, it will log out what it has mapped and see if your localhost:8080/MyApp/search is truly mapped.

You might not need the "/" in front of "search" in your @RequestMapping. I always have issues where I have a "/" in front or not.

Mark



The problem turned out to be how I'd defined the method signature in the controller.

It works now!

Thanks again.

mike
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Mike London wrote:
Mark Spritzler wrote:I am assuming you have your web.xml DispatcherServlet mapped to MyApp/*?

When you deploy your applicaiton, what does it show in the logs for mapped URLs, it will log out what it has mapped and see if your localhost:8080/MyApp/search is truly mapped.

You might not need the "/" in front of "search" in your @RequestMapping. I always have issues where I have a "/" in front or not.

Mark



The problem turned out to be how I'd defined the method signature in the controller.

It works now!

Thanks again.

mike



Cool.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring 3 Newbie Question
 
Similar Threads
Tomcat url redirect problem
Impl Front Controller Pattern on root level
Please help me about JSP rollDice (HFSJ)
Help to find the error.
Does MultiAction Controller work with Https?