******************************************************************************************
Apologies for Cross Postings
******************************************************************************************

Hello Everyone,

I am facing a peculiar problem which I would like to share with the
group..

I am trying to do an HTTP "get" to send the form element values to a
JSP.I do this using a request.getParameterNames() which returns an
Enumeration object.I am trying to read this Enumeration using the
enumeration objects nextElement() method into a vector which will be
used for further processing based on the data retreived.

This form gets filled by a database query and the number of rows that
are retreived would vary and are dependent upon the number of rows that
match the SQL select query statement.Each row consist of two textboxes
which are the parameters that are sent across to the JSP in this case.

A typical URL with parameter in this case is something like this

http://localhost:4444/xyz.jsp? myselect_sk0=wh&myselect_macro0=weather
&myselect_sk1=sp&myselect_macro1=sports &change=CHANGE

In this case myselect_sk and myselect_macro are the form element names
that are captured using the getParameterNames and values retreived using
the getParameterValues which returns a String array..

the problem that I am facing is that if you notice the last parameter
that is being passed to the query string is change which in this case
has a value CHANGE..This is a submit button which is being sent as a
parameter..When I am trying to print the values in the enumeration
object it typically prints all the values in the following manner

myselect_sk0(first checkbox element in the first row)
myselect_sk1(first checkbox element in the second row)
myselect_sk2(first checkbox element in the third row)
...........so on
change  (the button element )
myselect_macro0(second checkbox element in the first row)
myselect_macro1(second checkbox element in the second row)
myselect_macro2(second checkbox element in the third row)
...........so on

If you have a look at the order of the parameter that are being passed
they are in the order
myselect_sk0=wh&myselect_macro0=weather&myselect_sk1=sp&myselect_macro1=sports&change=CHANGE...
ie first checkbox element in the first row,second checkbox element in
the first row,first checkbox element in the second row,second checkbox
element in the second row and so on...........

But on being stored in the enumeration they are getting stored in the
way shown above..This is unuusal to me..
I want to avoid the change button value which is getting read in between
the two textbox element values as when i read the element values in a
loop the loop gets exhausted before the last element is
processed..giving me a java.util.NoSuchElementException : HashTable
Enumerator

Secondly I am running this loop which gets created dynamically based on
the no of rows that are retreived. I really have a need to get all the
textbox elements alone avoiding the change button parameter..

Could somebody help me out and explain me how is it that the parameters
are sent in case of multiple textbox elements in a row of a form.please
note ,This problem doesn't arise in case of single textbox as in that
case the change button is the last parameter.It can be avoided by doing
a Enumeration Object.nextElement() before entering the loop.

I would also like to know if there are any limitations of the no of
characters that can be sent in a post/get methods..I believe the get
method has a limit of 256 chars for it to behave properly ..Correct me
if I am wrong..

Hope the problem description is clear enough...Looking forward to
responses!!

Thanks in Advance!!

Regards,
Biju

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to