• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SimpleFormController and request parameters

 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my scenario:
I have a list.jsp, showing a list of things. You can click on a thing, and it will show another jsp page, to edit the thing.
The link looks like "/modify.htm?id=2"

list.jsp
AAAAA "/modify.htm?id=2"
BBBBB "/modify.htm?id=3"
CCCCC "/modify.htm?id=12"


I'm using a SimpleFormController, with this mapping:
<prop key="/modify.htm">ThingEditController</prop>

I have troubles to get the id in the form view.
I've tried to override showForm, get the id from the HttpServletRequest, and pass it back to the ModelAndView.
Without success.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

why dont u go for multiactioncontroller.. which would solve the problem you have i suppose.

regards
Magesh
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I suppose that you have a form to edit your object.

Try it, imagine that you want to edit a book)





The command class of your form displayed to edit the book have to has that property:



And then, in your form, in name field (for example)



Regards,
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jordi, thank you very much.
It worked by overriding formBackingObject

magesh, thanks for the suggestion.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic