Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pass parameters into servlet

 
jaya sudha
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..........

can i pass Parameters to servlets ? how can i read those ?

please can any one answer this...THANKS
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaya,
You can pass http parameters (from a form or url) or initialization parameters (from the web.xml.)
 
siva krishnan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Parameters can be passed in many ways..one of the most common usage is passing the value from a front-end FORM.
Each FORM element will have a NAME and a VALUE.
By specifying request.getParameter(<FORM-ELEMENT-NAME> you can get the value which was entered for that element.
eg: To get the employee number enetered in a textbox named "EmpNum" in the front-end FORM, you can use:
request.getParameter("EmpNum");
This will give the value entered for emp number.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds to me like you could use a good old fasioned tutorial on Servlets and maybe JSP.

Sun's J2EE Tutorial is pretty good. Chapter 11 is on Java Servlets and Chapter 12 is on JSP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic