Greetings,

I'm interested in knowing by what means do people control JSP page
layout in servlet->jsp setup (servlet always gets called and then
forwards request to JSP or redirects to static page).

Or to give a simple example:
During authorization there are several stages:
1. Enter login page
2. Entered password incorrect
3. Entered password correct / Log in
4. Log off

I can think of few ways of doing this:
1.  Have four (or so) separate HTML pages that user is redirected to by
means of redirect call in servlet. Tradeoff here is that those silly
small pages have to be coded up with all the HTML around them.

2. Have a request parameter like stage in servlet and put different
values in it and forward to JSP page where with if statements it could
be determined as to what's happening.  Here you have the top banners and
all the jazz in place and just change to heart of the page depending on
what's needed.

Authorize.jsp
<% if (request.getAttribute("AuthStage").equals("1")) {  %>
Please Enter password:
FORM HERE

<% }else if (request.getAttribute("AuthStage").equals("2")) {  %>
You have entered incorrect password
FORM HERE

<% }else if (request.getAttribute("AuthStage").equals("2")) {  %>
You have been logged off.

<% } %>

3.  ...

Ok so two ways of doing this.

This is just a silly example but it applies to any type of servlet-jsp
interaction.  Is it better to always use a bean to communicate
something?  Is it ok to use requst attributes?  Would it rather depend
on how comroftable the HTML designer is with these tags?  Is it ok to
not to care about how many HTML pages are required (every response gets
its own separate HTML page) ?  Is there a 'golden middle-ground' here?

And most importantly: Is there a much better way of doing this?

Thanks for any input,

dave.

--
David Mossakowski        [EMAIL PROTECTED]
http://www.dwdog.com/styk      212.310.7275

"I don't sit idly by, I'm planning a big surprise"
F         U         G         A        Z        I

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

Reply via email to