What is the value of auto-assigning beans?

2001-05-30 Thread greyson . smith

This question may be asked out of ignorance, but it seems to me that using
the tag:

jsp:useBean id=MyBean scope=session class=Test.MyBean /
jsp:setProperty name=MyBean property=* /

to assign values from form fields to the bean is of limited use.

Let's assume that there are 2 text fields, A and B on Jsp1.jsp, with B
being required.  I have some code that checks to make sure B is populated,
if it's not, the browser returns to Jsp1.jsp.

The problem I run into is that I can populate A with a value, submit the
form, get returned to Jsp1.jsp, delete A and populate B, submit the form,
and continue.  I how have values for both A and B, even though A was blank.

I suspect that I'm not the first person to ask this question, is there an
obvious solution that I missed, if not, what do other people do to get
around this problem; do all of the assignements by hand?

Thanks.


--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.





RE: What is the value of auto-assigning beans?

2001-05-30 Thread Jann VanOver

If you don't want the values to persist, don't put the bean in the session
scope.  Try page or request and then it will get new values each time.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 9:59 AM
To: [EMAIL PROTECTED]
Subject: What is the value of auto-assigning beans?


This question may be asked out of ignorance, but it seems to me that using
the tag:

jsp:useBean id=MyBean scope=session class=Test.MyBean /
jsp:setProperty name=MyBean property=* /

to assign values from form fields to the bean is of limited use.

Let's assume that there are 2 text fields, A and B on Jsp1.jsp, with B
being required.  I have some code that checks to make sure B is populated,
if it's not, the browser returns to Jsp1.jsp.

The problem I run into is that I can populate A with a value, submit the
form, get returned to Jsp1.jsp, delete A and populate B, submit the form,
and continue.  I how have values for both A and B, even though A was blank.

I suspect that I'm not the first person to ask this question, is there an
obvious solution that I missed, if not, what do other people do to get
around this problem; do all of the assignements by hand?

Thanks.


--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.




Re: What is the value of auto-assigning beans?

2001-05-30 Thread Boris Niyazov

1. setProperty in jsp does not have any effect if the value is empty string.  
2. you use scope session

So when set A it stores it in the session bean, next time when you set B with no 
A, B gets set in the bean and A remains the same (session scope).

hth
*
* Boris NiyazovPh:  212-854-4094  Fax: 212-854-1749 *
* Systems Manager  Email: [EMAIL PROTECTED] * 
* Columbia Law School  URL: http://www.law.columbia.edu *
*  
 


This question may be asked out of ignorance, but it seems to me that using
the tag:

jsp:useBean id=MyBean scope=session class=Test.MyBean /
jsp:setProperty name=MyBean property=* /

to assign values from form fields to the bean is of limited use.

Let's assume that there are 2 text fields, A and B on Jsp1.jsp, with B
being required.  I have some code that checks to make sure B is populated,
if it's not, the browser returns to Jsp1.jsp.

The problem I run into is that I can populate A with a value, submit the
form, get returned to Jsp1.jsp, delete A and populate B, submit the form,
and continue.  I how have values for both A and B, even though A was blank.

I suspect that I'm not the first person to ask this question, is there an
obvious solution that I missed, if not, what do other people do to get
around this problem; do all of the assignements by hand?

Thanks.


--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.





RE: What is the value of auto-assigning beans?

2001-05-30 Thread greyson . smith


Yes, I considered that, but I need the values to persist.   The only data
in the bean that needs to change in the bean is the data that corresponds
to the form fields.  Perhaps the answer is to have several beans that
expire every request, but if you need to persist the data, you still end up
copying all of the elements from one spot to another.  So I'm still left
with the question of Is auto-assigning worth the trouble.



   
 
Jann VanOver   
 
Jann.VanOver@loTo: '[EMAIL PROTECTED]' 
 
udeye.com  [EMAIL PROTECTED]   
 
cc:
 
30-05-01 12:07  Subject: RE: What is the value of 
auto-assigning beans? 
PM 
 
Please respond 
 
to tomcat-user 
 
   
 
   
 




If you don't want the values to persist, don't put the bean in the
session
scope.  Try page or request and then it will get new values each time.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 9:59 AM
To: [EMAIL PROTECTED]
Subject: What is the value of auto-assigning beans?


This question may be asked out of ignorance, but it seems to me that using
the tag:

jsp:useBean id=MyBean scope=session class=Test.MyBean /
jsp:setProperty name=MyBean property=* /

to assign values from form fields to the bean is of limited use.

Let's assume that there are 2 text fields, A and B on Jsp1.jsp, with B
being required.  I have some code that checks to make sure B is populated,
if it's not, the browser returns to Jsp1.jsp.

The problem I run into is that I can populate A with a value, submit the
form, get returned to Jsp1.jsp, delete A and populate B, submit the form,
and continue.  I how have values for both A and B, even though A was blank.

I suspect that I'm not the first person to ask this question, is there an
obvious solution that I missed, if not, what do other people do to get
around this problem; do all of the assignements by hand?

Thanks.


--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.




--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.





RE: What is the value of auto-assigning beans?

2001-05-30 Thread Jann VanOver

You could perhaps solve this with some Javascript tricks.  On the page with
the forms, check the fields before submitting and set some value in a hidden
field to pass it on to your bean.

I do this with check boxes because if they're not checked, they don't send
form data, yet I wanted to capture that unchecked event and pass it to my
bean.  I use Javascript on the checkbox to update a hidden field
(itemChecked) to yes or no and then use THIS field in my bean rather
than the actual check box.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 11:49 AM
To: [EMAIL PROTECTED]
Subject: RE: What is the value of auto-assigning beans?



Yes, I considered that, but I need the values to persist.   The only data
in the bean that needs to change in the bean is the data that corresponds
to the form fields.  Perhaps the answer is to have several beans that
expire every request, but if you need to persist the data, you still end up
copying all of the elements from one spot to another.  So I'm still left
with the question of Is auto-assigning worth the trouble.



 

Jann VanOver

Jann.VanOver@loTo:
'[EMAIL PROTECTED]'  
udeye.com  [EMAIL PROTECTED]

cc:

30-05-01 12:07  Subject: RE: What is the
value of auto-assigning beans? 
PM

Please respond

to tomcat-user

 

 





If you don't want the values to persist, don't put the bean in the
session
scope.  Try page or request and then it will get new values each time.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 9:59 AM
To: [EMAIL PROTECTED]
Subject: What is the value of auto-assigning beans?


This question may be asked out of ignorance, but it seems to me that using
the tag:

jsp:useBean id=MyBean scope=session class=Test.MyBean /
jsp:setProperty name=MyBean property=* /

to assign values from form fields to the bean is of limited use.

Let's assume that there are 2 text fields, A and B on Jsp1.jsp, with B
being required.  I have some code that checks to make sure B is populated,
if it's not, the browser returns to Jsp1.jsp.

The problem I run into is that I can populate A with a value, submit the
form, get returned to Jsp1.jsp, delete A and populate B, submit the form,
and continue.  I how have values for both A and B, even though A was blank.

I suspect that I'm not the first person to ask this question, is there an
obvious solution that I missed, if not, what do other people do to get
around this problem; do all of the assignements by hand?

Thanks.


--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.




--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.