You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pankaj Borgaonkar <pa...@wipro.com> on 2003/07/10 08:40:23 UTC
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.
***************************************************************************
Re: Validate method going in infinite Loop
Posted by Nagendra Kumar O V S <na...@ikigo.com>.
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-------
From: Struts Users Mailing List
Date: Thursday, July 10, 2003 12:11:05 PM
To: struts-user@jakarta.apache.org
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.
***************************************************************************