Hi,

Since the PSR for Servlet 2.3/JSP 1.2 just came out, I would like to make a
request that I feel would be a nice and time saving advantage over the
current Model 2 approach. One of the "best" arguments I believe for Model 1
over Model 2 is that the <jsp:setProperty name="bean_name" property="*" />
automatically fills in the beans properties by calling the setXXX() methods
of the bean that match the same name as the names in the <input> tags of a
form. This is a BIG time saver in my opinion, especially if you use many
beans for different forms. The primary reason I dont use Model 2 is this,
and I would think (my opinion ofcourse) many others have the same
reasoning, is that with Model 2, you have to create a bean, fill in the
properties with however many calls to
mybean.setXXX(request.getParameter("XXX")), then put the bean in the
session. It would be a great help if there was a way to create a bean and
pass it the request object (say in a constructor) that would then
automatically fill in the beans fields (using the same method it does
now..introspection) to save the time involved. The way around this now
would be to create the bean, call a method passing it the request object
from the servlet, and in the bean code have the
setXXX(request.getParameter("XXX")) to make the servlet code look cleaner.
But, your still doing the same thing..writing the code to set all the
properties using the request.getParameter().

Call me lazy..I am sure its feasible to do it now..but I would think this
could be automated in some way, maybe as part of the Servlet engine to
facilitate filling in a classes setXXX methods with a request object.

Anyone agree, disagree, have ideas on better ways to make this work?

Thanks.


Kevin Duffey
Software Engineer
[EMAIL PROTECTED]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to