I wonder if I can create a class -Person.java- and encapsulate full name, date of birth, and town of birth in that class. So I think, it is possible to do this :
Person person = request.getParameter("person");
It might be something like struts's ActionForm, but in pure JSP/servlet.
Thanks before
Eddy Lee Sin Ti
Ranch Hand
Joined: Oct 06, 2005
Posts: 135
posted
0
Well, jsp:useBean might meet your need. What it does is that it will auto populate your Javabean from the http request parameter. Of course, some naming conventions has to be followed.
Hope this helps. Cheers
SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
Timotius Pamungkas
Greenhorn
Joined: Feb 26, 2005
Posts: 28
posted
0
Thanks for your answer Eddy. However, I'm just started learning JSP/Servlet, thus it might take a while for me to understand jsp:usebean. If you don't mind, can you give me a simple example about that?
I think what Eddy Lee Sin Ti was referring to was the jsp:setProperty tag that goes with jsp:useBean. If you're using a JSP to retrieve the HTTP post parameters, there is a convenient way to transfer all of them to a bean.
Section JSP5.2 of the JSP spec (link in my signature) covers this.
These days, you don't see too many people using JSPs to retrieve form parameters. It is now considered bad form to use JSPs for anything but formatting output.
These days, you don't see too many people using JSPs to retrieve form parameters. It is now considered bad form to use JSPs for anything but formatting output.
>> So, is there more elegant way to retrieve form parameters?