Hi,

 

I have a problem where for some unknown reason my form is submitted
twice.  I have a action class which calls a delegate which calls a DAO
class. 

 

When I press submit the form is submitted.  My code in the JSP is as
follows:

 

Javascript function called when submitting form:

 

function setAction(action) 

{

            

            document.pendingRecordForm.action.value= action;     

            document.pendingRecordForm.submit();     

}

 

To submit the form the following image:

<html:image src="../images/save_button.jpg"
onclick="setAction('approve')"/>

 

The submit then calls the perform method in my struts action class ( By
the way I am using 1.0.2 version of Struts)

 

The action class then works through the code and when the thread gets to
the DAO class the second call arrives at the action class, 

 

This second call sends back a target of failure because of some
validation error and the successful target from the first submit is
ignored.

 

I don't understand why my form gets submitted twice.

 

The struts config is as follows for the action:

 

<action path="/approvexxxx"

        type="com.myclass.xxxx"

        name="pendingRecordForm"

        scope="request"

        input="/jsp/approvexxxxxx.jsp">

        <forward name="failure" path="/jsp/approvexxxxxx.jsp"/>

        <forward name="success" path="/jsp/menu.jsp"/>

    </action>

      

 

Thanks in advance

 

Reply via email to