You can populate beans with data in a number of ways - when the bean is
first constructed you can use the setProperty tags, if the bean alread
exists you can write a scriptlet (usually in Java) to call methods on the
bean - if you've followed the bean guidelines these will be setXXX methods
where XXX is the name of the property.

Beans can be 'stored' by the jsp engine, depending on what you are doing you
will need to have the bean stored in the 'request', 'session' or
'application.' So if you are calling one JSP page from another (using the
requestDispatcher) store the bean in a session. If you want the bean stored
across calls from the user, use the session object, and if you want the bean
stored for all users put in in the application object, so

<jsp:useBean id="fred" class="com.somebean.Bean", scope="session">
<jsp:setProperty name="myProp", value="0" />
</jsp:useBean>

<%
        out.write("value of bean is " + fred.getMyProp());
%>


Hope this helps,

Kevin


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Woodson, Brandon
(AC-Atlanta)
Sent: 21 July 1999 20:03
To: [EMAIL PROTECTED]
Subject: Variable Passing, Java Beans, and confusion


I have a basic form in a .jsp I want to use.

I have 4 variables that I would like to send to the Java Bean,
CalculateBean.

I would then like to send those 4 variables from the CalculateBean to
another jsp.

The original values in the form will be null.... On the second page, I want
to repopulate the same form with the new values that
were submitted on the previous page.


It sounds simple, but I am yet to run across any code that does this. I
confess that I am new to the JSP environment, but I can not go any further
until I figure out how to do this.



Brandon Woodson
Content Engineer
Autoconnect.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".

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