You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Charbel Abdul-Massih <ca...@desktone.com> on 2008/02/11 22:23:25 UTC
Every action is getting called twice
What am I doing wrong? Every request to an action goes into the actions' execute method twice...
I am sure that I am returning SUCCESS from the action, and is mapped to a valid JSP.
Thanks,
Charbel
Re: Every action is getting called twice
Posted by Van Riper <va...@gmail.com>.
On 2/11/08, Charbel Abdul-Massih <ca...@desktone.com> wrote:
> What am I doing wrong? Every request to an action goes into the actions' execute method twice...
This is going to sound unrelated, but, do you use Firefox browser with
Firebug enabled to test your code. I ran into one weird problem myself
where I was seeing double executions when Firebug was enabled. That
may not be the problem in your case, but, your symptoms are similar to
my situation where this was indeed the culprit. If you normally test
with Firebug enabled, disable it and try your test again to see
whether that changes things at all.
Good Luck, Van
--
| Mike "Van" Riper
| http://weblogs.java.net/blog/van_riper/
-----
| Silicon Valley Web Developer JUG
| mailto:van_riper@dev.java.net
| https://sv-web-jug.dev.java.net
-----
| Silicon Valley Google Technology User Group
| mailto:van.gtug@gmail.com
| http://sv-gtug.org
-----
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
[OT] Re: Every action is getting called twice
Posted by Dave Newton <ne...@yahoo.com>.
VenuGopalArkala wrote:
> if ur using <html:submit ...... onClick='formSubmit()'>
> and in js ur giving
> function formSubmit(){
> document.populationSetForm.addNewR.value = '';
> form.submit(); // this is the problem
> }
>
> Instead of form.submit() give return true; // ur problem will be solved
O_o
1) Original poster was using Struts 2
2) Original poster wasn't having an issue with forms
3) Original poster posted a year ago
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Every action is getting called twice
Posted by VenuGopalArkala <ve...@gmail.com>.
if ur using <html:submit ...... onClick='formSubmit()'>
and in js ur giving
function formSubmit(){
document.populationSetForm.addNewR.value = '';
form.submit(); // this is the problem
}
Instead of form.submit() give return true; // ur problem will be solved
Manish(Java) wrote:
>
> HI, Charbel
>
> In your problem, please make sure that your deployed application context
> is
> loaded only once. Because here,the problem might be related with it.
>
> Try it first and see what happens.
>
> Manish
> ----- Original Message -----
> From: "Charbel Abdul-Massih" <ca...@desktone.com>
> To: <us...@struts.apache.org>
> Sent: Tuesday, February 12, 2008 2:53 AM
> Subject: Every action is getting called twice
>
>
> What am I doing wrong? Every request to an action goes into the actions'
> execute method twice...
>
> I am sure that I am returning SUCCESS from the action, and is mapped to a
> valid JSP.
>
> Thanks,
> Charbel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Every-action-is-getting-called-twice-tp15420991p22288419.html
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: Every action is getting called twice
Posted by Prajapati Manish <pr...@sigmainfo.net>.
HI, Charbel
In your problem, please make sure that your deployed application context is
loaded only once. Because here,the problem might be related with it.
Try it first and see what happens.
Manish
----- Original Message -----
From: "Charbel Abdul-Massih" <ca...@desktone.com>
To: <us...@struts.apache.org>
Sent: Tuesday, February 12, 2008 2:53 AM
Subject: Every action is getting called twice
What am I doing wrong? Every request to an action goes into the actions'
execute method twice...
I am sure that I am returning SUCCESS from the action, and is mapped to a
valid JSP.
Thanks,
Charbel
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Every action is getting called twice
Posted by Laurie Harper <la...@holoweb.net>.
Another simple sanity check would be to delete the content of your JSP
(not the JSP itself, just make it an empty file). If that solves the
problem, you have an <img> tag with an empty 'src' attribute or
something similar that's causing the browser to issue another request to
the same URL.
L.
Wes Wannemacher wrote:
> If you remove your custom interceptor, do you have the same problem?
>
> If answer == no, post your interceptor code. There may be something that
> you're not seeing that multiple eyes can help you with.
>
> Else
>
> Try putting your interceptor below the ref to paramPrepareParamsStack,
> I've found it's usually better to put your own interceptors after the s2
> interceptors as they perform quite a bit of processing that one might
> assume has already happened.
>
> -Wes
>
> On Mon, 2008-02-11 at 16:30 -0500, Charbel Abdul-Massih wrote:
>> Here's a snippet from my struts.xml
>>
>> <interceptors>
>> <interceptor name="login" class="com.....LoginInterceptor" />
>>
>> <interceptor-stack name="defaultLoginStack">
>> <interceptor-ref name="login" /> <!-- Our LoginInterceptor -->
>> <interceptor-ref name="paramsPrepareParamsStack" />
>> </interceptor-stack>
>> </interceptors>
>>
>> <!-- Default interceptor stack. -->
>> <default-interceptor-ref name="defaultLoginStack"/>
>>
>>
>> <action name="dashboard" class="com......DashboardAction">
>> <result>/jsp/dashboard.jsp</result>
>> </action>
>>
>> When I access dashboard.action, the execute method is called twice...
>> The login interceptor checks for logged in session, and if true, calls
>>
>> Return actionInvocation.invoke();
>>
>> Does this help any???
>>
>>
>> -----Original Message-----
>> From: Dave Newton [mailto:newton.dave@yahoo.com]
>> Sent: Monday, February 11, 2008 4:26 PM
>> To: Struts Users Mailing List
>> Subject: Re: Every action is getting called twice
>>
>> --- Charbel Abdul-Massih <ca...@desktone.com> wrote:
>>> What am I doing wrong? Every request to an action goes into the actions'
>>> execute method twice...
>>>
>>> I am sure that I am returning SUCCESS from the action, and is mapped to a
>>> valid JSP.
>> You are not providing enough information for anybody to help you.
>>
>> Dave
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Every action is getting called twice
Posted by Wes Wannemacher <we...@wantii.com>.
If you remove your custom interceptor, do you have the same problem?
If answer == no, post your interceptor code. There may be something that
you're not seeing that multiple eyes can help you with.
Else
Try putting your interceptor below the ref to paramPrepareParamsStack,
I've found it's usually better to put your own interceptors after the s2
interceptors as they perform quite a bit of processing that one might
assume has already happened.
-Wes
On Mon, 2008-02-11 at 16:30 -0500, Charbel Abdul-Massih wrote:
> Here's a snippet from my struts.xml
>
> <interceptors>
> <interceptor name="login" class="com.....LoginInterceptor" />
>
> <interceptor-stack name="defaultLoginStack">
> <interceptor-ref name="login" /> <!-- Our LoginInterceptor -->
> <interceptor-ref name="paramsPrepareParamsStack" />
> </interceptor-stack>
> </interceptors>
>
> <!-- Default interceptor stack. -->
> <default-interceptor-ref name="defaultLoginStack"/>
>
>
> <action name="dashboard" class="com......DashboardAction">
> <result>/jsp/dashboard.jsp</result>
> </action>
>
> When I access dashboard.action, the execute method is called twice...
> The login interceptor checks for logged in session, and if true, calls
>
> Return actionInvocation.invoke();
>
> Does this help any???
>
>
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@yahoo.com]
> Sent: Monday, February 11, 2008 4:26 PM
> To: Struts Users Mailing List
> Subject: Re: Every action is getting called twice
>
> --- Charbel Abdul-Massih <ca...@desktone.com> wrote:
> > What am I doing wrong? Every request to an action goes into the actions'
> > execute method twice...
> >
> > I am sure that I am returning SUCCESS from the action, and is mapped to a
> > valid JSP.
>
> You are not providing enough information for anybody to help you.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Every action is getting called twice
Posted by Charbel Abdul-Massih <ca...@desktone.com>.
Here's a snippet from my struts.xml
<interceptors>
<interceptor name="login" class="com.....LoginInterceptor" />
<interceptor-stack name="defaultLoginStack">
<interceptor-ref name="login" /> <!-- Our LoginInterceptor -->
<interceptor-ref name="paramsPrepareParamsStack" />
</interceptor-stack>
</interceptors>
<!-- Default interceptor stack. -->
<default-interceptor-ref name="defaultLoginStack"/>
<action name="dashboard" class="com......DashboardAction">
<result>/jsp/dashboard.jsp</result>
</action>
When I access dashboard.action, the execute method is called twice...
The login interceptor checks for logged in session, and if true, calls
Return actionInvocation.invoke();
Does this help any???
-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com]
Sent: Monday, February 11, 2008 4:26 PM
To: Struts Users Mailing List
Subject: Re: Every action is getting called twice
--- Charbel Abdul-Massih <ca...@desktone.com> wrote:
> What am I doing wrong? Every request to an action goes into the actions'
> execute method twice...
>
> I am sure that I am returning SUCCESS from the action, and is mapped to a
> valid JSP.
You are not providing enough information for anybody to help you.
Dave
---------------------------------------------------------------------
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: Every action is getting called twice
Posted by Dave Newton <ne...@yahoo.com>.
--- Charbel Abdul-Massih <ca...@desktone.com> wrote:
> What am I doing wrong? Every request to an action goes into the actions'
> execute method twice...
>
> I am sure that I am returning SUCCESS from the action, and is mapped to a
> valid JSP.
You are not providing enough information for anybody to help you.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org