|
hi,
well then..
do not perform any validations in the validate method. (leave it
empty).
do this email validation in the action class. so if ur email is
invalid add that to errors and also get other data from db and then
forward to jsp.
so this will display both ur error and other db data
make sure u create the errors object as usual and u shoud save those
errors to the request object using
saveErrors(errors,request)
--nagi
-------Original Message-------
Date: Thursday, July
10, 2003 12:45:24 PM
Subject: RE: Validate
method going in infinite Loop
Thanks Nagendra....
But on the
JSP page I want to show both the errors as well as the data (
form bean variable which are populated in the performAction() method of
action class. )
i.e. in
validate method if email address is invalid then I am adding the errors
and forwarding to JSP page, this page will show the errors only but not
the formbean values
as it has not
gone into the performAction(). So I need to show the errors also and the
data also from database. This data is not used for validating the email
address but it is used for showing some suggested email
addresses.
Please reply
Pankaj
|
hi pankaj,
<action path="/emailcreation"
type="com.onstar.myonstar.process.web.controller.EmailCreationAction"
name="emailCreationForm"
validate="true" scope="request" input="/emailcreation.mo">
<forward
name="emailcreation_page" path="/jsp/virtualadvisor/emailcreation/va_pr_emailsetup_main.jsp" redirect="false"/> </action>
** this action mapping goes into a infinite loop , becos, if
u find an error ur calling emailcreation.mo(input parameter). that
is it is calling itself. and hence infinte loop. everytime u call
emailcreation.mo , validate method will be called.
<action path="/emailcreation"
type="com.onstar.myonstar.process.web.controller.EmailCreationAction"
name="emailCreationForm"
validate="true" scope="request" input="/jsp/virtualadvisor/emailcreation/va_pr_emailsetup_main.jsp">
<forward
name="emailcreation_page" path="/jsp/virtualadvisor/emailcreation/va_pr_emailsetup_main.jsp" redirect="false"/> </action>
**
this seems to be ok , becos ur forwarding the controll to
/jsp/virtualadvisor/emailcreation/va_pr_emailsetup_main.jsp(input
parameter) and the jsp page should display ur error. and if u want
to get data from db(for validation) , get it from validate method
only. ur control will never go action class unless all the
validations are success..
--nagi
-------Original
Message-------
Date: Thursday,
July 10, 2003 12:11:05 PM
Subject:
Validate method going in infinite Loop
Hi All,
I am validating email address
entered by user, using in validate method of formBean. If the
email address is invalid I am adding the errors.
Struts
Config entries:
<action path="/emailcreation"
type="com.onstar.myonstar.process.web.controller.EmailCreationAction"
name="emailCreationForm"
validate="true" scope="request" input="/jsp/virtualadvisor/emailcreation/va_pr_emailsetup_main.jsp">
<forward
name="emailcreation_page" path="/jsp/virtualadvisor/emailcreation/va_pr_emailsetup_main.jsp" redirect="false"/> </action>
OR
<action
path="/emailcreation"
type="com.onstar.myonstar.process.web.controller.EmailCreationAction"
name="emailCreationForm"
validate="true" scope="request" input="/emailcreation.mo">
<forward
name="emailcreation_page" path="/jsp/virtualadvisor/emailcreation/va_pr_emailsetup_main.jsp" redirect="false"/> </action>
Second
one is going into the loop and first one is not getting
the values from database as the request is going to JSP not to
action class i.e the formbean values are not
populate.
How can I overcome this problem.
Thanks in
Advance
Regards Pankaj Borgaonkar Wipro
Technologies
**************************Disclaimer************************************
Information
contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by
the individual or entity to which it is addressed. You are
notified that any use, copying or dissemination of the
information contained in the E-MAIL in any manner whatsoever
is strictly
prohibited.
***************************************************************************
|
|