Use the <html:img> tag instead of <html:image>
Read here for the difference:
http://struts.apache.org/struts-taglib/tagreference-struts-html.html

-----Original Message-----
From: Faisal Shoukat [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 06, 2006 10:47 AM
To: user@struts.apache.org
Subject: form submitted twice

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

 


**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to