struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Where do I use EJB's in struts framework
Date Fri, 01 Sep 2000 05:58:07 GMT
Mark Mascolino-MR/PGI wrote:

> Chris,
> I can definitely see where my Action classes could send requests off to say
> Stateless Session EJBs for business logic, but I am bit confused about how my
> choice of EJBs effect the presentation portion of the application.  After I
> complete my business logic and forward to a JSP to build the resulting page, how
> should I access the changed state of the model?  Do i keep around a handle to
> the EJB?  Do I populate some normal bean, etc.?

Keeping a handle to the EJB (as a request attribute or session attribute) would certainly
be one way to
do it, as long as you had property getter methods that could retrieve the state information
needed for
the user interface.  The JSP page doesn't really care whether a particular bean is a JavaBean
or an
EJB, as long as it has methods with the right names to be called.

Alternatively, your business logic could copy the relevant state information into regular
that are used solely for the UI.  This would eliminate a dependency on having appropriate
getters on
the EJB itself, but introduces a similar dependency on the intermediary bean having all the

> mark
> Mark Mascolino
> The Procter & Gamble Co.

Craig McClanahan

See you at ApacheCon Europe <>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

View raw message