If someone can help me with this, you will be my hero!!

Here is what I am trying to do.

Let's say there is a jsp page that gets passed in a parameter
that is the name of a person.  This page displays all the info
about that person and has an edit button at the bottom.

Person.jsp
----------
<html>
<jsp:useBean id="Session" class="com.beans.Session"
scope="session"/>
<jsp:useBean id="person" class="com.beans.data.PersonBean"
scope="session"/>
<% person.processRequest(request); %>
            .
            .
            .

This will instantiate the PersonBean.  And the processRequest
method will make a call to the database to fetch the person and
set the fields in the bean.  The form action is set to
PersonEdit.jsp.  PersonEdit.jsp displays the same data but in
textfields for editing.  There is a
save button at the bottom.

PersonEdit.jsp
--------------
<html>
<jsp:useBean id="Session" class="com.beans.Session"
scope="session"/>
<jsp:useBean id="person" class="com.beans.data.PersonBean"
scope="session"/>
<jsp:setProperty name='person' property='*'/>
                .
                .
<form method="post" action="PersonAction.jsp">
Stock:
    <input type="text" name="stock" value="<jsp:getProperty
name='person' property='address'/>">
<br>
    <input type="submit" value="Save">

When the user hits save, all the input fields have corresponding
names in the PersonBean so they automatically get set and are
available in PersonAction.jsp.

This is all cool and works because the PersonBean's scope is
always set to session.  This poses a big problem however if the
user has more than one browser up.  Then the bean is shared and
data gets clobbered.  I cannot for the life of me figure out a
good solution to this.  I'm thinking that maybe beans are not the
way to go.  I don't know how to make it work if the PersonBean's
scope is not set to session.  Is there a entirely different
approach I should use?  Comments/help please!

Thanks
Jill

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

Reply via email to