• 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

Spring - passing values by parametrs to Controller

 
Ranch Hand
Posts: 120
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey

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

now try in this way.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic