jguich wrote:
> what is the best approach?
>
> 1. servlet -> jsp -> ejb
> 2. servlet -> ejb
> 3. jsp -> ejb
> 4. servlet -> jsp
It depends very much on the complexity of the application you are building.
The first decision to make is whether you need EJB or not. This depends
primarily on whether the application is updating an operational database or not.
If your web users are simply looking at online catalogues and entering orders,
and the orders are transfered separately to the operational systems then you
could get away without EJB. However if they are accessing an operational
database at the same time as other users, eg if web user order entry checks and
updates the stock control database then you should use EJB. Since this is an EJB
mailing list let's assume you are going to do this.
The second decision is how to deal with the presentation layer. As has been said
often here, JSPs are compiled into servlets, so there's nothing you can do with
a JSP that you can't do with a servlet. But the advantage of JSPs is that they
can be generated (using the right tools) by web designers with no programming
skills. So you should give your web designers the advanced tools and use JSPs
(plus of course pure HTML).
Finally there comes the decision whether or not also to use servlets. Servlets
are more flexible than JSPs so there may be cases when you need a servlet to
handle complex presentation logic. I think you should not rule it out, but you
should minimise the use of servlets.
So I think for a reasonably complex application the answer is:
5. JSP and HTML -> servlet in some cases -> EJB
Ian McCallion
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".