Florian Falkenstein wrote:

> Hy all !
>
> I want to know how to use beans in web applications.
> I'm quite familiar with the Model 2 and want to use it
> for implementing my web application, but I have some
> problems to use beans.
>
> With the <jsp:useBean> and <jsp:setProperty property="*">
> I can easily fill a Bean with all Properties automatically.
> But the Model 2 aproach uses servlets for request processing,
> so that I have to set the Properties "by hand".
> I looked into the "struts"-Framework-documentation (jakarta)
> and saw that they call the corresponding setter methods
> automatically. Is there a way to do that with servlets, or
> do I have to use Reflection ?
>

Struts implements this little trick using reflection -- in pretty much the same way
that the generated code for a JSP page does it.

You can call BeanUtils.populate() -- from the struts.jar file -- yourself, in any
servlet you want, even if you are not using the Struts controller servlet.  It's
just plain old Java code.

>
> Thanks in advance,
>   Florian
>

Craig

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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

Reply via email to