> -----Original Message-----
> From: Denise Mangano [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, January 07, 2003 9:19 PM
> To: 'Tomcat Users List'
> Subject: Java Bean Scope questions (a lengthy one)
> 
> 
> Question #1: Why does CCSubmit.jsp not have access to 
> formBean properties. I am thinking this is because 
> technically by submitting a form with an action of 
> "CCSubmit.jsp" control isn't being forwarded to CCSubmit.jsp 
> so the instance of formBean isn't forwarded.  The scope of 
> formBean is request. Is that the correct scope to use?  **I 
> need to have access to formBean properties from the moment it 
> is instantiated to the moment the application
> has completed, but it has to be unique to each user of the 
> webapp.**   How
> could I accomplish this?

That's exactly what session scope is for. :-) Request scope means that
the bean is gone at the end of the request (that is, when Verify.jsp
finishes rendering).  If you put it in session scope you'll be set.

> Question #2: Is it possible to use two beans within a single 
> jsp page?  I would imagine that it is, and if so I believe 
> once I gain access to formBean properties, my transaction 
> properties will no longer be null. (I included some code 
> below... is this legal?)

Absolutely!  As long as they have different id attributes, you can use
as many beans as you like.

> Question #3:  I include a button to give the option to go 
> back and make changes.  If the user should desire to go back 
> and make changes, control should be forwarded to Retry.jsp on 
> button click.  I need to program this button in a way so that 
> when Retry.jsp is recalled it will still have access to 
> formBean properties.How do I program this? My last attempt 
> using <jsp:forward> cause Retry.jsp to load automatically 
> when Verify.jsp was loaded (sorry again Noel ;) ). 

As long as the bean is in session scope, you'll be able to access it
from any page the user accesses.
-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to