• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring 3 Newbie Question

 
Bartender
Posts: 1938
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
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
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
 
Mike London
Bartender
Posts: 1938
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
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

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
reply
    Bookmark Topic Watch Topic
  • New Topic