Meaningless Drivel is fun!*
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "pass parameters into servlet" Watch "pass parameters into servlet" New topic
Author

pass parameters into servlet

jaya sudha
Greenhorn

Joined: Jun 18, 2004
Posts: 20
Hi..........

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

please can any one answer this...THANKS


Sudha
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30369
    
150

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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
siva krishnan
Greenhorn

Joined: Apr 26, 2003
Posts: 21
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.


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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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: http://aspose.com/file-tools
 
subject: pass parameters into servlet