This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes Getting error when submitting form using SpringMVC and REST 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 "Getting error when submitting form using SpringMVC and REST" Watch "Getting error when submitting form using SpringMVC and REST" New topic
Author

Getting error when submitting form using SpringMVC and REST

James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 215
Hello there,

Created an online form in JSP using SpringMVC tag libraries. The controller for my form is a RESTful web service.

The RESTful web service has two calls:

(1) http://localhost:8080/myapp/applications/new

This brings up the online form in the browser (this works).

(2) http://localhost:8080/myapp/applications/create

This saves the form data to a database (handles submit). This is where it breaks.

Followed the conventions from the sample demo petclinic app which comes with the Spring Framework.

Online form:



The RESTful web service which serves as form controller:



Exception thrown when I click on submit:



Does anyone know why I am getting this exception?

Would really appreciate it if someone could help me with this issue...

Happy programming and thank you for taking the time to read this.
James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 215
Found the solution!

It was a RESTEasy problem... The fix was putting the @Form Application App inside the parameter list and prepending the domain model object's setters with @FormParam("name").

Source: Integrating RESTEasy with SpringMVC
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting error when submitting form using SpringMVC and REST
 
Similar Threads
Neither BindingResult nor plain target object for bean name 'vids2m1' available as request attribute
How to get Hebrew text from JSP page correctly?
Help with SpringMVC form tag
Unable to call Controller method after form submission using Spring MVC 3
Help submitting forms via SpringMVC and RESTful Web Service