aspose file tools*
The moose likes Servlets and the fly likes How to send user input to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to send user input to servlet" Watch "How to send user input to servlet" New topic

How to send user input to servlet

Ghazala Islam
Ranch Hand

Joined: Nov 22, 2000
Posts: 73
As we send parameters and their values with hyperlink e.g http://
.....?param=value, in this case value is constant,but if we want to send user input not hard coded value in a text field,how can we capture this value?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
Use request.getParameter and request.getparameterValues to get the parameters sent in from the submission of your form.


So much trouble in the world -- Bob Marley
Ghazala Islam
Ranch Hand

Joined: Nov 22, 2000
Posts: 73
Yoy didn't get my point,I'm asking how to send value that is not constant i.e user input
<input type = text name = param >
it doesn't have value clause,when user will enter date I want to send that value with url address.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
If you have the following form:
<FORM ACTION="somepage.jsp" METHOD="GET">
<INPUT TYPE="text" NAME="paramOne">
If the user enters the value valueOne, then the following page will be requested:
If the form method is GET, the form values are tacked on as query parameters. If you use POST, they are sent as post parameters. Either way, they are available via the request object as parameters.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: How to send user input to servlet
Similar Threads
session tracking
set value to form element
A method with many parameters.........
Send Japanese Characters from JSP to Servlet
we ask for user input in c by writing & (ampersand) but how to achieve this in java ?