> You can do this, but I have found that using the "Model 2" approach from the
> 0.92 spec (JSP page posts to servlet, which stores data in a session bean and
> forwards to the next JSP page) is particularly useful in the scenario where the
> "next" JSP page depends on the processing results.
>
> For example, let's say you have a form that enters an order. It is done in a
> JSP page so that you can pre-fill-in any information you already know from bean
> properties. You've got some client side validations, but you can't check
> everything until the order is submitted.
>
> The submission is to a "real" servlet that accepts the entry form and does the
> server-side validation checks that are necessary before storing the order in
> the database (perhaps checking the customer's credit limit against the order
> total, for example). Then, the servlet does one of two things depending on the
> success of this checking:
>
> * If the checks are OK, store the order in the database
> and use a ResourceDispatcher.forward() call to send
> control to the "menu" page (or whatever is appropriate
> in your application).
>
> * If the checks are not OK, use ResourceDispatcher.forward()
> to send control back to the order entry form, with a special
> property set that will create an error message. The form will
> still be filled out from the bean properties, so the user does not
> have to fill them in again.
>
> The key is that you don't know ahead of time which "next" page should be
> displayed. With a servlet, you get to choose the URI path that you pass to
> your ResourceDispatcher (note -- this becomes RequestDispatcher in the 2.1
> servlet API). If you are already in the JSP page that received the form
> parameters, the only way to do this would be conditional logic -- and that's
> going to get REALLY messy.
This is a real important point here. I totaly agree with you that with
the current specification there is no realy other way to do that.
But the problem I see with this approach is that we want that the design
of the web site is up to Web Designer not software engineer. So in fact,
yes the sotware engineers will write the business logic (validation,
storing into the Database...) but they should return "ok" or "not ok",
and the Web designer should take the right decision to what they want to
do according to this return.
Here we don't have the choice but to hard code in the servlet what page
to display. So if the web designer decides to change the "ok page" to
something completly different he has to ask a software engineer to
change the servlet as well. Which is not really nice.
With 0.92 we cannot do differently... is there something we can expect
in that direction for 1.0 ?
Yan
--
http://eowyn.fr.eu.org/~yan/ | [EMAIL PROTECTED]
SocialNet: Where people connect... http://www.socialnet.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".