File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes pass parameters into servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "pass parameters into servlet" Watch "pass parameters into servlet" New topic

pass parameters into servlet

jaya sudha

Joined: Jun 18, 2004
Posts: 20

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

please can any one answer this...THANKS

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32819

You can pass http parameters (from a form or url) or initialization parameters (from the web.xml.)

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
siva krishnan

Joined: Apr 26, 2003
Posts: 21

Parameters can be passed in many 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:
This will give the value entered for emp number.

Cheers<br />Siva<br />SCJP 1.4<br />SCWCD 1.3
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

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.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: pass parameters into servlet
It's not a secret anymore!