values between beans

Hi all,

got question about giving variables to Beans

i'v got LoginForm bean with session scope where user login and 'user' entity is set in this bean. on another page i use bean AccountController (scope=request) to addAccount but i don't now how to give the entity 'user' from LoginForm to AccountController. I tried to use jsp:useBean class="bean.AccountController" and setProperty but that create another instance of AccountController and give the entity to it instad of set the right variable in original bean.

Does anybody know how to do it?

<jsp:useBean class="bean.AccountController" id="AC" scope="request" />

<jsp:setProperty name="AC" property="user" value="${LoginForm.user}" />

<c:out value="$AC.user" />-- this prints out 'entity.user[51]'

<c:out value="$AccountController.user"> this prints out 'nothing'

[900 byte] By [pcisara] at [2007-11-27 7:55:47]
# 1

U need not do anything!!!

1. u get the login data from LoginForm which is in session onto ur jsp

2. When u submit the same data to AccountController the same value is submitted to the form no matter in which scope it is present.

Just you need to have the same variable name in both the forms

vinayak_ra at 2007-7-12 19:37:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Keep the data which needs to be submitted either in textbox, ..... or atleast as a hidden field in jsp
vinayak_ra at 2007-7-12 19:37:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...