Hi,

<snip>

<snip again>

I posted a question on this a week or two ago and don't recall seeing a
response. My email was down for 3 days so maybe some came across..so I
apologize if this is a repeat.

I went to a seminar on JSP/JavaBean/EJB use not too long ago, and from my
understanding, on the EJB side of things you have entity beans and session
beans. Ideally you want to use single-instance session beans and store the
session information in the HttpSession (if this is correct or not, please
elaborate). So, based on all the discussiones of Model 2 and action classes
we have been having, I figured the best thing to do was create and populate
a JavaBean in the action class from the request object, then pass that
object to the EJB session that performs the logic. It would then modify the
contents of the bean via its get/set methods, and then return the bean back
to the action class. The action class would then forward it on to a JSP page
for viewing. Ofcourse..the details are left out, but my question then as it
is now is, how would you pass a JavaBean object created (or retrieved from
the HttpSession) to the EJB, and then get it back again without creating yet
another bean? I apologize for I don't know the EJB spec very well, and it
would probably clear this up, but I don't have the time to read up on it
right now, yet I find myself trying to write a proposal for converting our
site to Model2/Action/JavaBean/JSP with the design including the ability to
easily incorporate EJB down the road.

On that note, I figured my action classes would be nothing more than
"adaptors" if thats the right term. They get passed the request, get or
create a bean and using a "static" helper method populate the bean with the
request parameters via introspection (like how a JSP engine does with a
JSP/Javabean and the property="*" setting). Next, the action class would
call one of our local "logic" classes (we call them session classes because
on multi-page forms, we do store them in the HttpSession) to perform the
logic using the bean fields set by the request object, and filling in more
(from results) or modifying existing ones. Later on, we could move those
"session" classes to the EJB side and just pass the JavaBean over to it and
get it back modified. Last thing that occurs is the JSP page is forwarded
to, to display the JavaBean fields dynamically.

So, is what I am trying to do and propose to my boss a flaw in design? Or is
this the right way to go? I realize there are many opinions and choices, but
ideally I want to figure out how to redo our front-end server-side stuff
from multiple servlets and JSP/JavaBeans (with logic in the JSP page to call
javabean methods) to one where ALL forms are submitted to one instance
controller and farmed out to instance action classes (as Craig and Daniel
have described..using a hashtable or whatever to store the single instance
of each class) through the lookup of an action name.

I would appreciate any ideas back on this before I submit my proposal on
Friday. ;) Sure would make it look better if I knew exactly what I am
proposing.

Thanks.

===========================================================================
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

Reply via email to