> franca...@yahoo.com wrote :
>
[quoted text clipped - 13 lines]
> --
> Wojtek :-)
Thanks, I assume I can create an object using JavaBean class where I
will take all the fields (via getter and setter methods) and use a
special method to grab all the fields into one object. Then call that
special method in my Servlet?
Lew - 20 Feb 2008 02:19 GMT
> I assume I can create an object using JavaBean class where I
> will take all the fields (via getter and setter methods) and use a
> special method to grab all the fields into one object. Then call that
> special method in my Servlet?
That's one way, although you don't really need any method more special than
doPost(), unless things get large enough to refactor.
You could also, for example, use the ServletRequest method getParameterMap()
and work directly off the Map of parameters:
<http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParam
eterMap()>
This has the advantage of grabbing all the parameters in one fell swoop, and
the disadvantage of leaving all the parameter values as unvalidated Strings
packaged in the String [] values of the Map.

Signature
Lew
Wojtek - 20 Feb 2008 18:14 GMT
fr-)ancan00@yahoo.com wrote :
>> franca...@yahoo.com wrote :
>>
[quoted text clipped - 17 lines]
> special method to grab all the fields into one object. Then call that
> special method in my Servlet?
Well, you CAN use a bean, but a simple class will also do. Extracting
form fields from the request is not all that difficult, and it lets you
condition the information, for things like valid input, ie: all numbers
for a numeric value, and within bounds, so that month value is within
1 and 12 inclusive.
NEVER assume that the user is kind enough to always enter valid values
:-)

Signature
Wojtek :-)
francan00@yahoo.com - 20 Feb 2008 22:44 GMT