You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "zul;jami" <zu...@hotmail.com> on 2007/10/10 13:39:57 UTC

Why does update action fire on load

I am using struts2+spring+jpa+ajax+sitemesh


WHile onload only execute method should be called,
but update is also called.Why

this is my struts.xml
<action name="login"  class="login">
       <result name="input">login.jsp</result>
       <result name="error">login.jsp</result>
       <result>/pages/dashboard_main.jsp</result>
</action>
 <action name="login_*" class="login" method="update">
            <result name="success">/pages/dashboard.jsp</result>
        </action>



-- 
View this message in context: http://www.nabble.com/Why-does-update-action-fire-on-load-tf4600249.html#a13134063
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


FW: Why does update action fire on load

Posted by abdul jabbar zul jami <zu...@hotmail.com>.
I have not yet solved the problem.

There is no  img tag with an empty src .Pls help.
regards
Zul Jami



From: zuljami@hotmail.comTo: user@struts.apache.orgSubject: RE: Why does update action fire on loadDate: Tue, 16 Oct 2007 04:42:27 +0000


Thanks for the reply.I added the update method only now.But when I login,it calls execue and update as well.I will check for  img tag with an empty src attribute as u have told.If you get any idea pls helpregardsZul Jami> To: user@struts.apache.org> From: laurie@holoweb.net> Subject: Re: Why does update action fire on load> Date: Mon, 15 Oct 2007 16:11:22 -0400> > zul;jami wrote:> > I am using struts2+spring+jpa+ajax+sitemesh> > > > > > WHile onload only execute method should be called,> > but update is also called.Why> > > > this is my struts.xml> > <action name="login" class="login">> > <result name="input">login.jsp</result>> > <result name="error">login.jsp</result>> > <result>/pages/dashboard_main.jsp</result>> > </action>> > <action name="login_*" class="login" method="update">> > <result name="success">/pages/dashboard.jsp</result>> > </action>> > This is just a guess, but I think a wildcard action name like login_* is > magic, in that it will match /login as well as /login_xxx. What happens > if you remove one or other of those action mappings?> > On the other hand it seems odd that two different action methods would > be called. Have you checked to confirm that's happening within a single > request? Another possibility is you have something in the returned page > (e.g. an img tag with an empty src attribute) that is triggering a > second request.> > L.> > > ---------------------------------------------------------------------> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org> For additional commands, e-mail: user-help@struts.apache.org> 



Check out some new online services at Windows Live Ideas—so new they haven’t even been officially released yet. Try it! 
_________________________________________________________________
Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today!
http://toolbar.live.com/?mkt=en-in

Re: Why does update action fire on load

Posted by Laurie Harper <la...@holoweb.net>.
zul;jami wrote:
> I am using struts2+spring+jpa+ajax+sitemesh
> 
> 
> WHile onload only execute method should be called,
> but update is also called.Why
> 
> this is my struts.xml
> <action name="login"  class="login">
>        <result name="input">login.jsp</result>
>        <result name="error">login.jsp</result>
>        <result>/pages/dashboard_main.jsp</result>
> </action>
>  <action name="login_*" class="login" method="update">
>             <result name="success">/pages/dashboard.jsp</result>
>         </action>

This is just a guess, but I think a wildcard action name like login_* is 
magic, in that it will match /login as well as /login_xxx. What happens 
if you remove one or other of those action mappings?

On the other hand it seems odd that two different action methods would 
be called. Have you checked to confirm that's happening within a single 
request? Another possibility is you have something in the returned page 
(e.g. an img tag with an empty src attribute) that is triggering a 
second request.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org