aspose file tools*
The moose likes Spring and the fly likes Spring - passing values by parametrs to Controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring - passing values by parametrs to Controller" Watch "Spring - passing values by parametrs to Controller" New topic
Author

Spring - passing values by parametrs to Controller

sandeep lokhande
Ranch Hand

Joined: Jan 25, 2010
Posts: 118

Is this possible to send some parameters to Controller in spring?
I am trying to send empid from some .jsp and want to process it on Controller.
I have not access to request and response object in my Controller.

my Controller is as,


Can i Do it?
If yes, then please suggest me how to do it.
Thank you in advance.

Thanks and Regards,
Sandeep Lokhande.
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
of-course you can and that is why they are called controller sticking to MVC architecture,
the thing you must POST the values while submitting the page i;e specify method=POST in the form tag and specify the action attribute to which the proper mapping should be done in your spring configuration file & now in the controller your method will have the parameters of HttpServletRequest , HttpServletRespone and ..... as far as your requirement and method signature is correct.

use the request object to get the parameters like


the string should match with the name of the textbox or what ever you have created in your jsp.
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
hey

it is only one of the method signature you can change it to your requirement, like

now try in this way.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring - passing values by parametrs to Controller