tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deacon Marcus" <deacon_mar...@wwtech.pl>
Subject RE: Ordering of parameters in HTTPRequest Object
Date Mon, 16 Jul 2001 13:47:47 GMT
Hi,

> -----Original Message-----
> From: Michael Wentzel [mailto:Michael.Wentzel@aswethink.com]
> Sent: Monday, July 16, 2001 2:39 PM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: RE: Ordering of parameters in HTTPRequest Object
>
>
> > Hello all, I am new to this mailing list, and Tomcat, so please pe
> > patient...
> >
> > I am using Servlets to recieve html form submissions.
> >
> > Problem is that the form fields are in a particular order on
> > the form, but
> > when I get the Parameters from the request object this field order is
> > gone...
> >
> > The post data comes in in the proper order, but I can not recover the
> > ordering.  If it was only 1 form I was dealing with, I could
> > write code to
> > format a response, but the app is very generalized, and it is
> > designed to
> > handle many different forms.
> >
> > So the question.   Is there no way in tomcat to preserve the
> > ordering of
> > parameters from a form submission?
>
> No.  This is servlet API thing, not a tomcat thing.  I think it's a bad
> idea to develop servlet to depend on the order in which a request object
> is formed because you never know for sure that an ordering is going to
> be fixed.  For example, say a hashing algorithm is used for speed up
> access.  How do you order the elements of a hash table?  The only thing
> I could suggest is preface every form element with its' order, 1st element
> would be 0_elementname and 9th element would be 8_elementname, then order
> the elements yourself, but I think this is kind of sloppy.

Maybe provide another hidden field in your form specifing order (<field
type="hidden" name="field-order" value="f1,f2,f3" > or something), then add
a filter (assuming you use T4.0/S2.3) prividing custom Request adding
methods for getting other fields by numbers.

>
>
> ---
> Michael Wentzel
> Software Developer
> Software As We Think - http://www.aswethink.com

Greetings,
     deacon Marcus


Mime
View raw message