Kevin Duffey wrote:
> public final class BeanPropogate
> {
> public static final propogate(Object o, HttpServletRequest r)
> {
> // get request parameter names
> // loop through all names
> // using reflection, check if the object passed in has a setXXX method
> that matches each
> name from the request parameter list of names
> // if so, call it passing to it the request parameter value of the name
> // if not, ignore it.
> }
> }
>
> Is something like above good? I think this is what the JSP engine does for
> Model 1 JSP/JavaBean use when setProperty="*" is used. Seems to me the best
> way to do this..but like I said, I would rather use a single method for ALL
> action classes so as not to keep repeating code.
>
This is pretty much what Tomcat does when you use <jsp:setProperty name="*"/>. If
you want the details, you can download the Tomcat source code
<http://jakarta.apache.org> and look at the introspect() method in the
org.apache.jasper.runtime.JspRuntimeLibrary.java class (under directory "src/share"
in the distribution).
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets