Craig,
A few questions/comments below:
Craig McClanahan wrote:
> If you look inside my apps, you'll see the following design pattern all over the
> place:
>
> * JSP page contains an input form. The values
> are pre-filled-in from a session bean that contains
> application default values the first time through,
> or the most recent inputs after a validation error
> (see below for more info).
Question: Do you extract this information from the HttpSession? I was
reading an article where they were saying that stuffing too much
information to Sessions may adversely effect the scalability of a high
traffic site. Is that true?
> * Form submit goes to a servlet (I tend to
> use a single servlet per app, others like
> a servlet per input form).
>
> * Servlet dispatches to the business logic
> responsible for processing this form.
We are starting a web application development and we plan to use
Servlets that will dispatch calls to the already existing EJBs for
business logic processing. The stateless session EJBs fit nicely with
the HTTP request/response paradigm.
> * The most recent set of form inputs are
> saved in the session bean (used in the first
> step) in case a validation error is detected.
>
> * If the business logic detects a validation
> error, it stores an error message bean and
> forwards control back to the original JSP page
> containing the form. The form can then be
> redisplayed with the previous inputs in it,
> along with the error message. The user
> only needs to modify what needs fixing rather
> than starting from scratch.
>
> * If the validation checks all pass, the business
> logic performs the required function, stores any
> results in session beans, and forwards control
> to the next JSP page to display the results.
I agree with your mixed approach because:
1. It is awkward to write a complex HTML page using out.println() in a
servlet.
2. If my JSPs have too much Java code in them, then they have more then
just presentation logic.
just my 2 cents..
Anirban
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html