Hi,
In ur servlet u can use the following code to get what ever comes to ur
processing page. Then try to parse to get what u want.
InputStream in = request.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
while ((thisLine = br.readLine()) != null) { // while loop begins here
System.out.println("thisline = " + thisLine + "end");
} // end while
Hope this helps.
thanks
vinodh
-----Original Message-----
From: Witold Iwaniec [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 12:17 PM
To: JDJList
Subject: [jdjlist] Servlet request and HTML element attributes
Hello
Is there a way, in a servlet application, to get values on "non-default"
attributes of elements on a page?
For example, if on my web page I have:
<input name="EMAIL" type="text">
in the HttpServletRequest I will have parameter with teh name "EMAIL"
and value whatever the textbox contains.
I wonder if there is a way to read other attributes, in this case value of
"type".
Actually here is my problem.
On the pages where user has to enter values, some of the fields are
required. If the value is blank, I would redisplay the page, with values
that have already been entered and display error message.
I know that there are some options:
- it can be done thorugh a JavaScript right on the client
- in my servlet code I can now which are required elements and deal
with it
- store the elements in a table
- others
But I would like to write a generic procedure that checks required
elements. I could, for example, add attribute to the HTML elements:
<input name="EMAIL" type="text" required="yes">
and in the code iterate through the request parameters, dynamically
find out which are required, and deal with it.
Thanks
Witold
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm