jguich wrote:
>
> what is the best approach?
>
> 1. servlet -> jsp -> ejb
> 2. servlet -> ejb
> 3. jsp -> ejb
> 4. servlet -> jsp

How about:

5. servlet -> gui logic -> ejb
           -> jsp

The servlet invokes the GUI controller that processes form data,
calls the EJB business logic, creates some data "beans" and attaches
them to the request via setAttribute(), etc..  The servlet then
forwards the request to (or includes) the JSP page.  The JSP page,
via the USEBEAN directive, has access to the data "beans" that were
created by the servlet and can use that data in formatting the HTML
page.

With this scheme, you use JSP for HTML presentation services only.
And you avoid putting too much application logic into the JSP page.
You get to keep a separation between your presentation and business
logic.

-eric

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

Reply via email to