You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by xniit2003 <ar...@gmail.com> on 2007/12/01 10:15:12 UTC
my execute method of action class is getting executed twice
Hi,
I am new in struts2.
In my action class I declared some global fields and one execute method.This
class extends another class, which extends Actionsupport class. Now my
execute method is getting processed twice.
>From this execute method, execution goes to some other method, which also
getting processed twice.
Can anyone faced similar situation.
Thanks
--
View this message in context: http://www.nabble.com/my-execute-method-of-action-class-is-getting-executed-twice-tf4927568.html#a14103442
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: my execute method of action class is getting executed twice
Posted by Gary Affonso <gl...@greywether.com>.
xniit2003 wrote:
> Hi,
>
> I am new in struts2.
> In my action class I declared some global fields and one execute method.This
> class extends another class, which extends Actionsupport class. Now my
> execute method is getting processed twice.
>>>From this execute method, execution goes to some other method, which also
> getting processed twice.
>
> Can anyone faced similar situation.
Need more info (at least I do). What does your interceptor stack look
like? What is your the Action classes superclass doing? What "other
method" are you calling from within the Action's execute method? What
result code (or codes) does your action return? What result-type (or
types) are configured for these codes?
- Gary
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: my execute method of action class is getting executed twice
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
I think you should check if it's the browser that submits the form two
times.
> I thought was a bug of my application, but now i'm thinking it's a
> bug of
> struts 2 framework.
> I hope will be fix very soon.
> Regards
>
> Andrea
>
>
> xniit2003 wrote:
>>
>> Hi,
>>
>> I am new in struts2.
>> In my action class I declared some global fields and one execute
>> method.This class extends another class, which extends Actionsupport
>> class. Now my execute method is getting processed twice.
>> From this execute method, execution goes to some other method,
>> which also
>> getting processed twice.
>>
>> Can anyone faced similar situation.
>>
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
R: R: R: my execute method of action class is getting executed twice
Posted by "Gigliotti, Andrea" <an...@smurfitkappa.it>.
function actionConfirm() {
if(newConfirm('Confirmation Request','Are you sure to delete item ?',1,1,0)) {
// return document.forms[0].submit();
return true;
}
else return false;
}
I changed the row "return document.forms[0].submit();" in "return true;"
Andrea
-----Messaggio originale-----
Da: Dave Newton [mailto:newton.dave@yahoo.com]
Inviato: martedì 4 dicembre 2007 17.53
A: Struts Users Mailing List
Oggetto: Re: R: R: my execute method of action class is getting executed twice
What JavaScript confirm message?
*Please* post the complete code.
And stop copying me; replying to the list is fine.
d.
--- "Gigliotti, Andrea" <an...@smurfitkappa.it> wrote:
> I tried to remove the javascript confirm message, and now it work fine!
>
> I still have the localization problem with the package_it.properties file.
> This is a bug for sure!
>
> Andrea
>
> -----Messaggio originale-----
> Da: Dave Newton [mailto:newton.dave@yahoo.com]
> Inviato: martedì 4 dicembre 2007 15.38
> A: Gigliotti, Andrea
> Oggetto: Re: R: my execute method of action class is getting executed twice
>
> Okay, now post the rest of it: the action
> configuration, the HTML/JSP, any additional
> JavaScript, etc.
>
> d.
>
> --- "Gigliotti, Andrea"
> <an...@smurfitkappa.it> wrote:
>
> > Below my configuration:
> >
> > O.S. Windows XP Pro (ITA)
> > Tomcat 5.0.27
> > JDKL 1.5.0.12
> > IE 6.0
> >
> >
> > Action's code:
> > - - - - - - - - - - - - -
> > package it.kappapackaging.com.action.visits;
> >
> > import java.sql.Connection;
> > import java.sql.DriverManager;
> >
> > import com.opensymphony.xwork2.ActionSupport;
> >
> > import it.kappapackaging.com.dao.VisitDao;
> > import it.kappapackaging.com.db.DBConnection;
> >
> > /**
> > * Base Action class for the Tutorial package.
> > */
> > public class Delete extends
> > it.kappapackaging.com.action.ActionBase {
> >
> >
> > public String execute() throws Exception {
> >
> > VisitDao vis = new VisitDao();
> > vis.setBean(request);
> >
> > if(vis.deleteBean() == 1) return SUCCESS;
> > else return ERROR;
> >
> > }
> >
> > }
> > - - - - - - - - - - - - -- - - - - - - - - - - - -
> > Method's code in class VisitDao:
> >
> > public int deleteBean() {
> > java.sql.Statement s = null;
> > String sql = "";
> > //Connection conn = null;
> > int ret = 0;
> > try {
> > //conn = DBConnection.getAccessConnection();
> > s =
> >
> DBConnection.getAccessConnection().createStatement();
> > //s = conn.createStatement();
> > sql = "DELETE FROM Visits";
> > sql += " WHERE vis_mill = '" +
> > decodeMill(mill_code) + "'";
> > sql += " AND vis_customer_code = " +
> > customerCode;
> > sql += " AND vis_date = Format('" + visitDate +
> > "', 'mm/dd/yyyy')";
> > sql += " AND vis_oper = '" + oper + "'";
> > sql += " AND vis_type = " + typeCode;
> > sql += " AND vis_inser = Format('" + visitInser +
> > "', 'mm/dd/yyyy HH:mm:ss')";
> > ret = s.executeUpdate(sql);
> > //DBConnection.getAccessConnection().commit();
> > } catch (SQLException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > }
> > finally {
> > try {
> > if(s != null) s.close();
> > //conn.close();
> > } catch (SQLException e) {
> > e.printStackTrace();
> > }
> > }
> > return ret;
> >
> > }
> > - - - - - - - - - - - - -
> >
> > The class ActionBase extends ActionSupport.
> > The action's execute method is called twice!
> >
> > Andrea
> >
> > -----Messaggio originale-----
> > Da: Dave Newton [mailto:newton.dave@yahoo.com]
> > Inviato: martedì 4 dicembre 2007 15.08
> > A: Struts Users Mailing List
> > Oggetto: Re: my execute method of action class is
> > getting executed twice
> >
> > --- giglian <an...@smurfitkappa.it>
> > wrote:
> > > The method return the number of rows deleted.
> >
> > What method does? A method being called by
> > execute()?
> >
> > > I thought was a bug of my application, but now i'm
> > > thinking it's a bug of struts 2 framework. I hope
> > > will be fix very soon.
> >
> > That's certainly possible, but I've certainly never
> > seen an extra call to execute() for no reason.
> >
> > Did you post your configuration and action code in
> > question?
> >
> > d.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
> >
> **********************************************************************
> > Le informazioni contenute in questa comunicazione
> > sono riservate e
> > destinate esclusivamente alla/e persona/e o
> > all'ente/i a cui sono
> > stati indirizzati. Se questa comunicazione Vi e'
> > pervenuta per errore,
> > siete pregati di informare il mittente rispondendo a
> > questa mail.
> >
> > Questa nota conferma inoltre che questa mail e'
> > stata verificata da un
> > opportuno programma contro la presenza di virus
> > informatici.
> >
> > This email and any files transmitted with it are
> > confidential and
> > intended solely for the use of the individual or
> > entity to whom they
> > are addressed. If you have received this email in
> > error please notify
> > the sender.
> >
> > This footnote also confirms that this email message
> > has been swept by
> > appropriate software for the presence of computer
> > viruses.
> >
> **********************************************************************
> >
>
>
> **********************************************************************
> Le informazioni contenute in questa comunicazione sono riservate e
> destinate esclusivamente alla/e persona/e o all'ente/i a cui sono
> stati indirizzati. Se questa comunicazione Vi e' pervenuta per errore,
> siete pregati di informare il mittente rispondendo a questa mail.
>
> Questa nota conferma inoltre che questa mail e' stata verificata da un
> opportuno programma contro la presenza di virus informatici.
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the sender.
>
> This footnote also confirms that this email message has been swept by
> appropriate software for the presence of computer viruses.
> **********************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
**********************************************************************
Le informazioni contenute in questa comunicazione sono riservate e
destinate esclusivamente alla/e persona/e o all'ente/i a cui sono
stati indirizzati. Se questa comunicazione Vi e' pervenuta per errore,
siete pregati di informare il mittente rispondendo a questa mail.
Questa nota conferma inoltre che questa mail e' stata verificata da un
opportuno programma contro la presenza di virus informatici.
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender.
This footnote also confirms that this email message has been swept by
appropriate software for the presence of computer viruses.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: R: R: my execute method of action class is getting executed twice
Posted by Dave Newton <ne...@yahoo.com>.
What JavaScript confirm message?
*Please* post the complete code.
And stop copying me; replying to the list is fine.
d.
--- "Gigliotti, Andrea" <an...@smurfitkappa.it> wrote:
> I tried to remove the javascript confirm message, and now it work fine!
>
> I still have the localization problem with the package_it.properties file.
> This is a bug for sure!
>
> Andrea
>
> -----Messaggio originale-----
> Da: Dave Newton [mailto:newton.dave@yahoo.com]
> Inviato: martedì 4 dicembre 2007 15.38
> A: Gigliotti, Andrea
> Oggetto: Re: R: my execute method of action class is getting executed twice
>
> Okay, now post the rest of it: the action
> configuration, the HTML/JSP, any additional
> JavaScript, etc.
>
> d.
>
> --- "Gigliotti, Andrea"
> <an...@smurfitkappa.it> wrote:
>
> > Below my configuration:
> >
> > O.S. Windows XP Pro (ITA)
> > Tomcat 5.0.27
> > JDKL 1.5.0.12
> > IE 6.0
> >
> >
> > Action's code:
> > - - - - - - - - - - - - -
> > package it.kappapackaging.com.action.visits;
> >
> > import java.sql.Connection;
> > import java.sql.DriverManager;
> >
> > import com.opensymphony.xwork2.ActionSupport;
> >
> > import it.kappapackaging.com.dao.VisitDao;
> > import it.kappapackaging.com.db.DBConnection;
> >
> > /**
> > * Base Action class for the Tutorial package.
> > */
> > public class Delete extends
> > it.kappapackaging.com.action.ActionBase {
> >
> >
> > public String execute() throws Exception {
> >
> > VisitDao vis = new VisitDao();
> > vis.setBean(request);
> >
> > if(vis.deleteBean() == 1) return SUCCESS;
> > else return ERROR;
> >
> > }
> >
> > }
> > - - - - - - - - - - - - -- - - - - - - - - - - - -
> > Method's code in class VisitDao:
> >
> > public int deleteBean() {
> > java.sql.Statement s = null;
> > String sql = "";
> > //Connection conn = null;
> > int ret = 0;
> > try {
> > //conn = DBConnection.getAccessConnection();
> > s =
> >
> DBConnection.getAccessConnection().createStatement();
> > //s = conn.createStatement();
> > sql = "DELETE FROM Visits";
> > sql += " WHERE vis_mill = '" +
> > decodeMill(mill_code) + "'";
> > sql += " AND vis_customer_code = " +
> > customerCode;
> > sql += " AND vis_date = Format('" + visitDate +
> > "', 'mm/dd/yyyy')";
> > sql += " AND vis_oper = '" + oper + "'";
> > sql += " AND vis_type = " + typeCode;
> > sql += " AND vis_inser = Format('" + visitInser +
> > "', 'mm/dd/yyyy HH:mm:ss')";
> > ret = s.executeUpdate(sql);
> > //DBConnection.getAccessConnection().commit();
> > } catch (SQLException e) {
> > // TODO Auto-generated catch block
> > e.printStackTrace();
> > }
> > finally {
> > try {
> > if(s != null) s.close();
> > //conn.close();
> > } catch (SQLException e) {
> > e.printStackTrace();
> > }
> > }
> > return ret;
> >
> > }
> > - - - - - - - - - - - - -
> >
> > The class ActionBase extends ActionSupport.
> > The action's execute method is called twice!
> >
> > Andrea
> >
> > -----Messaggio originale-----
> > Da: Dave Newton [mailto:newton.dave@yahoo.com]
> > Inviato: martedì 4 dicembre 2007 15.08
> > A: Struts Users Mailing List
> > Oggetto: Re: my execute method of action class is
> > getting executed twice
> >
> > --- giglian <an...@smurfitkappa.it>
> > wrote:
> > > The method return the number of rows deleted.
> >
> > What method does? A method being called by
> > execute()?
> >
> > > I thought was a bug of my application, but now i'm
> > > thinking it's a bug of struts 2 framework. I hope
> > > will be fix very soon.
> >
> > That's certainly possible, but I've certainly never
> > seen an extra call to execute() for no reason.
> >
> > Did you post your configuration and action code in
> > question?
> >
> > d.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
> >
> **********************************************************************
> > Le informazioni contenute in questa comunicazione
> > sono riservate e
> > destinate esclusivamente alla/e persona/e o
> > all'ente/i a cui sono
> > stati indirizzati. Se questa comunicazione Vi e'
> > pervenuta per errore,
> > siete pregati di informare il mittente rispondendo a
> > questa mail.
> >
> > Questa nota conferma inoltre che questa mail e'
> > stata verificata da un
> > opportuno programma contro la presenza di virus
> > informatici.
> >
> > This email and any files transmitted with it are
> > confidential and
> > intended solely for the use of the individual or
> > entity to whom they
> > are addressed. If you have received this email in
> > error please notify
> > the sender.
> >
> > This footnote also confirms that this email message
> > has been swept by
> > appropriate software for the presence of computer
> > viruses.
> >
> **********************************************************************
> >
>
>
> **********************************************************************
> Le informazioni contenute in questa comunicazione sono riservate e
> destinate esclusivamente alla/e persona/e o all'ente/i a cui sono
> stati indirizzati. Se questa comunicazione Vi e' pervenuta per errore,
> siete pregati di informare il mittente rispondendo a questa mail.
>
> Questa nota conferma inoltre che questa mail e' stata verificata da un
> opportuno programma contro la presenza di virus informatici.
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the sender.
>
> This footnote also confirms that this email message has been swept by
> appropriate software for the presence of computer viruses.
> **********************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: R: R: my execute method of action class is getting executed twice
Posted by Dave Newton <ne...@yahoo.com>.
--- "Gigliotti, Andrea" <an...@smurfitkappa.it> wrote:
> I tried to remove the javascript confirm message, and now it work fine!
Btw, I'm in the camp of the other comment that said you're probably
submitting it twice (without knowing, since you didn't post the complete
code). If you're doing a submit from within the handler somewhere and not
returning false to the "onclick" attribute then it will be submitted by both
your handler and via a regular form submission.
d.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
R: R: my execute method of action class is getting executed twice
Posted by "Gigliotti, Andrea" <an...@smurfitkappa.it>.
I tried to remove the javascript confirm message, and now it work fine!
I still have the localization problem with the package_it.properties file.
This is a bug for sure!
Andrea
-----Messaggio originale-----
Da: Dave Newton [mailto:newton.dave@yahoo.com]
Inviato: martedì 4 dicembre 2007 15.38
A: Gigliotti, Andrea
Oggetto: Re: R: my execute method of action class is getting executed twice
Okay, now post the rest of it: the action
configuration, the HTML/JSP, any additional
JavaScript, etc.
d.
--- "Gigliotti, Andrea"
<an...@smurfitkappa.it> wrote:
> Below my configuration:
>
> O.S. Windows XP Pro (ITA)
> Tomcat 5.0.27
> JDKL 1.5.0.12
> IE 6.0
>
>
> Action's code:
> - - - - - - - - - - - - -
> package it.kappapackaging.com.action.visits;
>
> import java.sql.Connection;
> import java.sql.DriverManager;
>
> import com.opensymphony.xwork2.ActionSupport;
>
> import it.kappapackaging.com.dao.VisitDao;
> import it.kappapackaging.com.db.DBConnection;
>
> /**
> * Base Action class for the Tutorial package.
> */
> public class Delete extends
> it.kappapackaging.com.action.ActionBase {
>
>
> public String execute() throws Exception {
>
> VisitDao vis = new VisitDao();
> vis.setBean(request);
>
> if(vis.deleteBean() == 1) return SUCCESS;
> else return ERROR;
>
> }
>
> }
> - - - - - - - - - - - - -- - - - - - - - - - - - -
> Method's code in class VisitDao:
>
> public int deleteBean() {
> java.sql.Statement s = null;
> String sql = "";
> //Connection conn = null;
> int ret = 0;
> try {
> //conn = DBConnection.getAccessConnection();
> s =
>
DBConnection.getAccessConnection().createStatement();
> //s = conn.createStatement();
> sql = "DELETE FROM Visits";
> sql += " WHERE vis_mill = '" +
> decodeMill(mill_code) + "'";
> sql += " AND vis_customer_code = " +
> customerCode;
> sql += " AND vis_date = Format('" + visitDate +
> "', 'mm/dd/yyyy')";
> sql += " AND vis_oper = '" + oper + "'";
> sql += " AND vis_type = " + typeCode;
> sql += " AND vis_inser = Format('" + visitInser +
> "', 'mm/dd/yyyy HH:mm:ss')";
> ret = s.executeUpdate(sql);
> //DBConnection.getAccessConnection().commit();
> } catch (SQLException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> finally {
> try {
> if(s != null) s.close();
> //conn.close();
> } catch (SQLException e) {
> e.printStackTrace();
> }
> }
> return ret;
>
> }
> - - - - - - - - - - - - -
>
> The class ActionBase extends ActionSupport.
> The action's execute method is called twice!
>
> Andrea
>
> -----Messaggio originale-----
> Da: Dave Newton [mailto:newton.dave@yahoo.com]
> Inviato: martedì 4 dicembre 2007 15.08
> A: Struts Users Mailing List
> Oggetto: Re: my execute method of action class is
> getting executed twice
>
> --- giglian <an...@smurfitkappa.it>
> wrote:
> > The method return the number of rows deleted.
>
> What method does? A method being called by
> execute()?
>
> > I thought was a bug of my application, but now i'm
> > thinking it's a bug of struts 2 framework. I hope
> > will be fix very soon.
>
> That's certainly possible, but I've certainly never
> seen an extra call to execute() for no reason.
>
> Did you post your configuration and action code in
> question?
>
> d.
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
>
**********************************************************************
> Le informazioni contenute in questa comunicazione
> sono riservate e
> destinate esclusivamente alla/e persona/e o
> all'ente/i a cui sono
> stati indirizzati. Se questa comunicazione Vi e'
> pervenuta per errore,
> siete pregati di informare il mittente rispondendo a
> questa mail.
>
> Questa nota conferma inoltre che questa mail e'
> stata verificata da un
> opportuno programma contro la presenza di virus
> informatici.
>
> This email and any files transmitted with it are
> confidential and
> intended solely for the use of the individual or
> entity to whom they
> are addressed. If you have received this email in
> error please notify
> the sender.
>
> This footnote also confirms that this email message
> has been swept by
> appropriate software for the presence of computer
> viruses.
>
**********************************************************************
>
**********************************************************************
Le informazioni contenute in questa comunicazione sono riservate e
destinate esclusivamente alla/e persona/e o all'ente/i a cui sono
stati indirizzati. Se questa comunicazione Vi e' pervenuta per errore,
siete pregati di informare il mittente rispondendo a questa mail.
Questa nota conferma inoltre che questa mail e' stata verificata da un
opportuno programma contro la presenza di virus informatici.
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender.
This footnote also confirms that this email message has been swept by
appropriate software for the presence of computer viruses.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
R: my execute method of action class is getting executed twice
Posted by "Gigliotti, Andrea" <an...@smurfitkappa.it>.
Below my configuration:
O.S. Windows XP Pro (ITA)
Tomcat 5.0.27
JDKL 1.5.0.12
IE 6.0
Action's code:
- - - - - - - - - - - - -
package it.kappapackaging.com.action.visits;
import java.sql.Connection;
import java.sql.DriverManager;
import com.opensymphony.xwork2.ActionSupport;
import it.kappapackaging.com.dao.VisitDao;
import it.kappapackaging.com.db.DBConnection;
/**
* Base Action class for the Tutorial package.
*/
public class Delete extends it.kappapackaging.com.action.ActionBase {
public String execute() throws Exception {
VisitDao vis = new VisitDao();
vis.setBean(request);
if(vis.deleteBean() == 1) return SUCCESS;
else return ERROR;
}
}
- - - - - - - - - - - - -- - - - - - - - - - - - -
Method's code in class VisitDao:
public int deleteBean() {
java.sql.Statement s = null;
String sql = "";
//Connection conn = null;
int ret = 0;
try {
//conn = DBConnection.getAccessConnection();
s = DBConnection.getAccessConnection().createStatement();
//s = conn.createStatement();
sql = "DELETE FROM Visits";
sql += " WHERE vis_mill = '" + decodeMill(mill_code) + "'";
sql += " AND vis_customer_code = " + customerCode;
sql += " AND vis_date = Format('" + visitDate + "', 'mm/dd/yyyy')";
sql += " AND vis_oper = '" + oper + "'";
sql += " AND vis_type = " + typeCode;
sql += " AND vis_inser = Format('" + visitInser + "', 'mm/dd/yyyy HH:mm:ss')";
ret = s.executeUpdate(sql);
//DBConnection.getAccessConnection().commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally {
try {
if(s != null) s.close();
//conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
return ret;
}
- - - - - - - - - - - - -
The class ActionBase extends ActionSupport.
The action's execute method is called twice!
Andrea
-----Messaggio originale-----
Da: Dave Newton [mailto:newton.dave@yahoo.com]
Inviato: martedì 4 dicembre 2007 15.08
A: Struts Users Mailing List
Oggetto: Re: my execute method of action class is getting executed twice
--- giglian <an...@smurfitkappa.it> wrote:
> The method return the number of rows deleted.
What method does? A method being called by execute()?
> I thought was a bug of my application, but now i'm
> thinking it's a bug of struts 2 framework. I hope
> will be fix very soon.
That's certainly possible, but I've certainly never
seen an extra call to execute() for no reason.
Did you post your configuration and action code in
question?
d.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
**********************************************************************
Le informazioni contenute in questa comunicazione sono riservate e
destinate esclusivamente alla/e persona/e o all'ente/i a cui sono
stati indirizzati. Se questa comunicazione Vi e' pervenuta per errore,
siete pregati di informare il mittente rispondendo a questa mail.
Questa nota conferma inoltre che questa mail e' stata verificata da un
opportuno programma contro la presenza di virus informatici.
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender.
This footnote also confirms that this email message has been swept by
appropriate software for the presence of computer viruses.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: my execute method of action class is getting executed twice
Posted by Dave Newton <ne...@yahoo.com>.
--- giglian <an...@smurfitkappa.it> wrote:
> The method return the number of rows deleted.
What method does? A method being called by execute()?
> I thought was a bug of my application, but now i'm
> thinking it's a bug of struts 2 framework. I hope
> will be fix very soon.
That's certainly possible, but I've certainly never
seen an extra call to execute() for no reason.
Did you post your configuration and action code in
question?
d.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: my execute method of action class is getting executed twice
Posted by giglian <an...@smurfitkappa.it>.
Hi,
I have the same problem, you can look at my message of November 30.
However see below the bug I posted:
"my web app have an action to delete one row in a MS Access table (access
though sun.jdbc.odbc.JdbcOdbcDriver).
The method return the number of rows deleted.
The first time it's executed, it return the right number of deleted rows: 1.
The action after reading the method result, it return SUCCESS, but rather to
call the result page (jsp page), the controller, with no reason, call once
again, the same method.
This time, of course, it return 0 because the row is already deleted and the
action return ERROR.
Finally, even if the delete operation execute succesfully, the web app
display the error message.
I have other action with methods that insert and update rows and they work
fine!
All methods have the same program logic except for the sql statement
(INSERT, UPDATE, DELETE, ...)"
I thought was a bug of my application, but now i'm thinking it's a bug of
struts 2 framework.
I hope will be fix very soon.
Regards
Andrea
xniit2003 wrote:
>
> Hi,
>
> I am new in struts2.
> In my action class I declared some global fields and one execute
> method.This class extends another class, which extends Actionsupport
> class. Now my execute method is getting processed twice.
> From this execute method, execution goes to some other method, which also
> getting processed twice.
>
> Can anyone faced similar situation.
>
> Thanks
>
--
View this message in context: http://www.nabble.com/my-execute-method-of-action-class-is-getting-executed-twice-tf4927568.html#a14151247
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org