You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mohd Amin Mohd Din <am...@nc.com.my> on 2003/07/14 03:52:11 UTC

Validation using Validator & java beans issue

Hi,
 
Having a snag using Validator, DynaValidatorForm and simple java beans.
An overview of the current application my team is currently building; We
use 2 Action classes for one jsp if the jsp has a html form in it else
we use 1 Action. Example, for changePassword.jsp we have
ChangePasswordSetupAction class which populates or do something to the
form before displaying it to the user. The form action of
changePassword.jsp points to ChangePasswordAction class which gets data
from changePassword.jsp form and does something with all the data. In
ChangePasswordSetupAction, we pass a bean containing info which is kept
as hidden field in changePassword.jsp. The fields in changePassword.jsp
are already specified in the form-bean section.
 
We have already done the application as a prototype and are now
inserting validation code into it. After validation is specified in
validation.xml for the changePassword form, the page can be viewed but
when testing for validation, example, leaving a field blank when it
should be filled, generates an error saying that it can't find the bean.
This happens when the bean is passed in a request, but everything is ok
when it is passed in a session.
 
The application has many pages, putting all the beans into a session
might cause performance degradation. Is there anyway this thing can be
solved by not putting the beans into a session?
 
-Amin