I found that it goes to main.jsp,
and update is called at once.
I have written code to call update only on change of select.
THis is code in my jsp.
*******
<body>
<s:form name="form1" >
<table border="0" align="center" cellspacing="0" cellpadding="0"
width="99%" >
<tr align="left" valign="top">
<td width="358" align="left">
images/dashboard.jpg
</td>
</tr>
<tr align="left" valign="top">
<td width="400" align="left">
<s:select id="triggerId" label=""
name="dashBoardSelector"
list="dashList"
value="defaultDashList"
size="1"
onchange="javascript: updateTarget();"/>
</td>
</tr>
<tr>
<s:url id="ajaxTest" value="/login!update.action" >
<s:param name="triggerValue" value="%{dashBoardSelector}" />
</s:url>
<s:div id="targetDivId" theme="ajax"
listenTopics="updateTargetTopic"
href="%{ajaxTest}">
INITIAL CONTENTS
</s:div>
*******
Igor Vlasov wrote:
>
> From this point of view I can not properly investigate the problem.
>
> May be run in debug mode and analyse when and where method "update" is
> called.....
> or make manually a NUllPointerError and see the stack trace.....
>
>
> zul;jami wrote:
>>
>> yes that is what i did I use only
>> <action name="login_*" class="login" method="{1}">
>> <result name="input">login.jsp</result>
>> <result name="error">login.jsp</result>
>> <result name="success">/pages/main.jsp</result>
>> <result name="success2">/pages/dashboard.jsp</result>
>> </action>
>> BUt still update is fired on login.
>>
>>
>> Igor Vlasov wrote:
>>>
>>> If you use only
>>>
>>> <action name="login_*" class="login" method="{1}">
>>> <result name="input">login.jsp</result>
>>> <result name="error">login.jsp</result>
>>> <result name="success">/pages/main.jsp</result>
>>> <result name="success2">/pages/dashboard.jsp</result>
>>> </action>
>>>
>>> the update action called when login_update.jspa is called or press on
>>> <input type="submit" name="method:update" />
>>>
>>>
>>>
>>>
>>> zul;jami wrote:
>>>>
>>>> After deleting the second binding also I got the same error.
>>>>
>>>>
>>>>
>>>> Igor Vlasov wrote:
>>>>>
>>>>> You have to delete second binding...
>>>>>
>>>>> zul;jami wrote:
>>>>>>
>>>>>> I have not deleted.instead I gave
>>>>>>
>>>>>> <action name="login_*" class="login" method="{1}">
>>>>>> <result name="input">login.jsp</result>
>>>>>> <result name="error">login.jsp</result>
>>>>>> <result>/pages/main.jsp</result>
>>>>>> </action>
>>>>>> <action name="update" class="login" method="update">
>>>>>> <result name="success">/pages/dashboard.jsp</result>
>>>>>> </action>
>>>>>>
>>>>>> But still update is fired when logging in.
>>>>>> What do you mean by <result name="success2">.
>>>>>> Both methods return SUCCESS only.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Igor Vlasov wrote:
>>>>>>>
>>>>>>> Are you sure that you delete:
>>>>>>> <action name="login_*" class="login" method="update">
>>>>>>> <result name="success">/pages/dashboard.jsp</result>
>>>>>>> </action>
>>>>>>>
>>>>>>> The process description:
>>>>>>> When call login_input.jspa then "input" method called
>>>>>>>
>>>>>>> When call login.jspa then "execute" method called.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> zul;jami wrote:
>>>>>>>>
>>>>>>>> After changing my struts.xml as you said
>>>>>>>> also my action fires execute and also update.
>>>>>>>> I do not want to fire update.Pls help
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Igor Vlasov wrote:
>>>>>>>>>
>>>>>>>>> I use
>>>>>>>>> <action name="login_*" class="login" method="{1}">
>>>>>>>>> <result name="input">login.jsp</result>
>>>>>>>>> <result name="error">login.jsp</result>
>>>>>>>>> <result name="success">/pages/main.jsp</result>
>>>>>>>>> <result name="success2">/pages/dashboard.jsp</result>
>>>>>>>>> </action>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> zul;jami wrote:
>>>>>>>>>>
>>>>>>>>>> I have two methods in action extending actionsupport in struts2.
>>>>>>>>>> WHen I login it should execute only the execute method.BUT
>>>>>>>>>> it also fires update another method which I want to call some
>>>>>>>>>> other time.
>>>>>>>>>>
>>>>>>>>>> THis is my struts.xml
>>>>>>>>>> **********
>>>>>>>>>> <action name="login" class="login">
>>>>>>>>>> <result name="input">login.jsp</result>
>>>>>>>>>> <result name="error">login.jsp</result>
>>>>>>>>>> <result>/pages/main.jsp</result>
>>>>>>>>>> </action>
>>>>>>>>>> <action name="login_*" class="login" method="update">
>>>>>>>>>> <result name="success">/pages/dashboard.jsp</result>
>>>>>>>>>> </action>
>>>>>>>>>> ***************
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Piero Sartini-3 wrote:
>>>>>>>>>>>
>>>>>>>>>>> Am Montag, 22. Oktober 2007 13:23:38 schrieb zul;jami:
>>>>>>>>>>>> Still I am getting the error,
>>>>>>>>>>>> my execute also fires update on load.
>>>>>>>>>>>> There is no img tag with empty src attribute
>>>>>>>>>>>
>>>>>>>>>>> execute() is triggered when the action is called, not only when
>>>>>>>>>>> you submit
>>>>>>>>>>> your data.
>>>>>>>>>>>
>>>>>>>>>>> Piero
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Why-does-update-action-fire-on-load-tf4670323.html#a13482612
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]