Re: struts double action execution!?

[email protected] Thu, 9 Oct 2003 23:30:17 +1000
Newsgroups gmane.comp.java.mvc.devel
Message-ID <OFD1D4B27E.C8824CA2-ONCA256DBA.004A1A68-CA256DBA.0049A097@multitask.com.au>
This is a multipart message in MIME format.
--=_alternative 0049A092CA256DBA_=
Content-Type: text/plain; charset="US-ASCII"

Have you sub-classed the RequestProcessor? if so I would look in there to 
see if there are any hassles with the code.

Cheers,

Kristen.
--
Kristen Gillard
Multitask Consulting Pty Ltd
Lvl 8, 20 Loftus Street,
Circular Quay, NSW, 2000
--
Ph:   61-2-9252-1462
Fx:   61-2-9252-4636
Mo:  0409-000-123
--
http://www.multitask.com.au/



"Otto, Frank" <[email protected]> 
Sent by: [email protected]
09/10/2003 10:37 PM
Please respond to
[email protected]


To
"'[email protected]'" <[email protected]>
cc

Subject
[MVC-Programmers] struts double action execution!?






Hello,
 
I have a difficult problem. My action was executed twice and I don't know 
why.
 
There is a global forward in my main.jsp:
 
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> 
<logic:forward name="startpage"/> 
 
 
struts-config.xml:
 
<struts-config> 
  <global-forwards> 
    <forward 
      name="startpage" 
      path="/action/welcome" /> 

   ... 
  </global-forwards> 

  <action-mappings> 
 
    <action 
      path="/welcome" 
      type="test.actions.CWelcomeAction" 
      name="loginForm" 
      scope="request" 
      validate="false"> 
      <forward 
        name="Success" path="dos.Welcome" /> 
    </action> 

    ... 
  </action-mappings> 
 
tiles-def.xml:
 
<tiles-definitions> 
   <definition name="dos.DefaultLayout" 
page="/pages/layouts/dosDefaultLayout.jsp"> 
            <put name="header" value="/pages/header/empty.jsp"/> 
            <put name="agb" value="/pages/submenu/common/agb.jsp"/> 
   </definition> 
 
   <definition name="dos.WelcomeLayout" extends="dos.DefaultLayout">   
                <put name="header" value="/pages/header/startpage.jsp"/> 
      <put name="mainmenu_top" value="/pages/mainmenu_top/emptymain.jsp"/> 

      <put name="mainmenu_bottom" 
value="/pages/mainmenu_bottom/welcomemain.jsp"/> 
      <put name="submenu" value="/pages/submenu/main/login.jsp"/> 
                <put name="navigation" 
value="/pages/navigation/empty.jsp"/> 
   </definition> 
 
   <definition name="dos.Welcome" extends="dos.WelcomeLayout"> 
                <put name="caption" 
value="/pages/captions/main/welcome.jsp"/> 
      <put name="content" value="/pages/mainpage/main/welcome.jsp"/> 
   </definition> 
... 
</tiles-definitions>
 
 
That was written in the log-file:
 
DEBUG 2003-10-09 08:50:46,204 - Get module name for path /action 
DEBUG 2003-10-09 08:50:46,204 - Module name found: default 
DEBUG 2003-10-09 08:50:46,205 - Processing a 'GET' for path '/welcome' 
DEBUG 2003-10-09 08:50:46,205 -  Looking for ActionForm bean instance in 
scope 'request' under attribute key 'loginForm' 
DEBUG 2003-10-09 08:50:46,205 -  Creating new ActionForm instance of type 
'test.forms.main.CLoginForm' 
DEBUG 2003-10-09 08:50:46,205 -  --> test.forms.main.CLoginForm@f507d2 
DEBUG 2003-10-09 08:50:46,205 -  Storing ActionForm bean instance in scope 
'request' under attribute key 'loginForm' 
DEBUG 2003-10-09 08:50:46,206 -  Populating bean properties from this 
request 
DEBUG 2003-10-09 08:50:46,206 - 
BeanUtils.populate(test.forms.main.CLoginForm@f507d2, {}) 
DEBUG 2003-10-09 08:50:46,206 -  Looking for Action instance for class 
test.actions.CWelcomeAction 
DEBUG 2003-10-09 08:50:46,206 -   Returning existing Action instance 
DEBUG 2003-10-09 08:50:46,206 - Begin   CWelcomeAction.execute() 
DEBUG 2003-10-09 08:50:46,206 - dispatch: 
ActionConfig[path=/welcome,name=loginForm,scope=request,type=test.actions.CWelcome 

Action 
... 
DEBUG 2003-10-09 08:50:46,211 - End     CWelcomeAction.execute() 
DEBUG 2003-10-09 08:50:46,211 - processForwardConfig(dos.Welcome, false) 
DEBUG 2003-10-09 08:50:46,212 - uri=/pages/layouts/dosDefaultLayout.jsp 
doInclud 
e=false 
DEBUG 2003-10-09 08:50:46,214 - insert page='/pages/header/startpage.jsp'. 

DEBUG 2003-10-09 08:50:46,219 - insert 
page='/pages/mainmenu_bottom/welcomemain. 
jsp'. 
DEBUG 2003-10-09 08:50:46,226 - insert 
page='/pages/submenu/main/login.jsp'. 
DEBUG 2003-10-09 08:50:46,230 - insert 
page='/pages/submenu/common/agb.jsp'. 
DEBUG 2003-10-09 08:50:46,236 - insert page='/pages/navigation/empty.jsp'. 

DEBUG 2003-10-09 08:50:46,238 - insert 
page='/pages/captions/main/welcome.jsp'. 
DEBUG 2003-10-09 08:50:46,240 - insert 
page='/pages/mainpage/main/welcome.jsp'. 
DEBUG 2003-10-09 08:50:46,242 -   'dos.Welcome' - processed as definition 

THE SECOND ONE:
DEBUG 2003-10-09 08:50:46,522 - Get module name for path /action 
DEBUG 2003-10-09 08:50:46,522 - Module name found: default 
DEBUG 2003-10-09 08:50:46,523 - Processing a 'GET' for path '/welcome' 
DEBUG 2003-10-09 08:50:46,523 -  Looking for ActionForm bean instance in 
scope ' 
request' under attribute key 'loginForm' 
DEBUG 2003-10-09 08:50:46,523 -  Creating new ActionForm instance of type 
'test.forms.main.CLoginForm' 
DEBUG 2003-10-09 08:50:46,526 -  --> test.forms.main.CLoginForm@d4 
a1d3 
DEBUG 2003-10-09 08:50:46,526 -  Storing ActionForm bean instance in scope 
'requ 
est' under attribute key 'loginForm' 
DEBUG 2003-10-09 08:50:46,526 -  Populating bean properties from this 
request 
DEBUG 2003-10-09 08:50:46,526 - BeanUtils.populate(test.forms.main 
.CLoginForm@d4a1d3, {}) 
DEBUG 2003-10-09 08:50:46,526 -  Looking for Action instance for class 
test.actions.CWelcomeAction 
DEBUG 2003-10-09 08:50:46,526 -   Returning existing Action instance 
DEBUG 2003-10-09 08:50:46,526 - Begin   CWelcomeAction.execute() 
DEBUG 2003-10-09 08:50:46,526 - dispatch: 
ActionConfig[path=/welcome,name=loginF 
orm,scope=request,type=test.actions.CWelcome 
Action 
... 
DEBUG 2003-10-09 08:50:46,548 - End     CWelcomeAction.execute() 
DEBUG 2003-10-09 08:50:46,550 - processForwardConfig(dos.Welcome, false) 
DEBUG 2003-10-09 08:50:46,551 - uri=/pages/layouts/dosDefaultLayout.jsp 
doInclud 
e=false 
DEBUG 2003-10-09 08:50:46,555 - insert page='/pages/header/startpage.jsp'. 

DEBUG 2003-10-09 08:50:46,562 - insert 
page='/pages/mainmenu_bottom/welcomemain. 
jsp'. 
DEBUG 2003-10-09 08:50:46,577 - insert 
page='/pages/submenu/main/login.jsp'. 
DEBUG 2003-10-09 08:50:46,582 - insert 
page='/pages/submenu/common/agb.jsp'. 
DEBUG 2003-10-09 08:50:46,584 - insert page='/pages/navigation/empty.jsp'. 

DEBUG 2003-10-09 08:50:46,585 - insert 
page='/pages/captions/main/welcome.jsp'. 
DEBUG 2003-10-09 08:50:46,586 - insert 
page='/pages/mainpage/main/welcome.jsp'. 
DEBUG 2003-10-09 08:50:46,587 -   'dos.Welcome' - processed as definition 
 
 
Has anyone an idea, where the mistake is? I thing all my actions were 
executed twice.
 
 
Regards,
 
Frank

--=_alternative 0049A092CA256DBA_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Have you sub-classed the RequestProcessor?
if so I would look in there to see if there are any hassles with the code.</font>
<br>
<br><font size=2 face="sans-serif">Cheers,</font>
<br>
<br><font size=2 face="sans-serif">Kristen.</font>
<br><font size=2 face="sans-serif">--<br>
Kristen Gillard<br>
Multitask Consulting Pty Ltd<br>
Lvl 8, 20 Loftus Street,<br>
Circular Quay, NSW, 2000<br>
--<br>
Ph: &nbsp; 61-2-9252-1462<br>
Fx: &nbsp; 61-2-9252-4636<br>
Mo: &nbsp;0409-000-123<br>
--<br>
http://www.multitask.com.au/</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>&quot;Otto, Frank&quot;
&lt;[email protected]&gt;</b> </font>
<br><font size=1 face="sans-serif">Sent by: [email protected]</font>
<p><font size=1 face="sans-serif">09/10/2003 10:37 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
[email protected]</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">&quot;'[email protected]'&quot;
&lt;[email protected]&gt;</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">[MVC-Programmers] struts
double action execution!?</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 face="Arial">Hello,</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">I have a difficult problem. My action was
executed twice and I don't know why.</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">There is a global forward in my main.jsp:</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">&lt;%@ taglib uri=&quot;/WEB-INF/struts-logic.tld&quot;
prefix=&quot;logic&quot; %&gt; <br>
&lt;logic:forward name=&quot;startpage&quot;/&gt; </font>
<br><font size=3>&nbsp;</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial"><b>struts-config.xml:</b></font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">&lt;struts-config&gt; <br>
 &nbsp;&lt;global-forwards&gt; <br>
 &nbsp; &nbsp;&lt;forward <br>
 &nbsp; &nbsp; &nbsp;name=&quot;startpage&quot; <br>
 &nbsp; &nbsp; &nbsp;path=&quot;/action/welcome&quot; /&gt; <br>
<br>
 &nbsp; ... <br>
 &nbsp;&lt;/global-forwards&gt; <br>
<br>
 &nbsp;&lt;action-mappings&gt; <br>
 &nbsp;<br>
 &nbsp; &nbsp;&lt;action <br>
 &nbsp; &nbsp; &nbsp;path=&quot;/welcome&quot; <br>
 &nbsp; &nbsp; &nbsp;type=&quot;test.actions.CWelcomeAction&quot; <br>
 &nbsp; &nbsp; &nbsp;name=&quot;loginForm&quot; <br>
 &nbsp; &nbsp; &nbsp;scope=&quot;request&quot; <br>
 &nbsp; &nbsp; &nbsp;validate=&quot;false&quot;&gt; <br>
 &nbsp; &nbsp; &nbsp;&lt;forward <br>
 &nbsp; &nbsp; &nbsp; &nbsp;name=&quot;Success&quot; path=&quot;dos.Welcome&quot;
/&gt; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp;&lt;/action&gt; <br>
<br>
 &nbsp; &nbsp;... <br>
 &nbsp;&lt;/action-mappings&gt; </font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial"><b>tiles-def.xml:</b></font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">&lt;tiles-definitions&gt; <br>
 &nbsp; &lt;definition name=&quot;dos.DefaultLayout&quot; page=&quot;/pages/layouts/dosDefaultLayout.jsp&quot;&gt;
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;put name=&quot;header&quot;
value=&quot;/pages/header/empty.jsp&quot;/&gt; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;put name=&quot;agb&quot;
value=&quot;/pages/submenu/common/agb.jsp&quot;/&gt; <br>
 &nbsp; &lt;/definition&gt; <br>
 &nbsp; &nbsp;<br>
 &nbsp; &lt;definition name=&quot;dos.WelcomeLayout&quot; extends=&quot;dos.DefaultLayout&quot;&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;put name=&quot;header&quot;
value=&quot;/pages/header/startpage.jsp&quot;/&gt; <br>
 &nbsp; &nbsp; &nbsp;&lt;put name=&quot;mainmenu_top&quot; value=&quot;/pages/mainmenu_top/emptymain.jsp&quot;/&gt;
<br>
 &nbsp; &nbsp; &nbsp;&lt;put name=&quot;mainmenu_bottom&quot; value=&quot;/pages/mainmenu_bottom/welcomemain.jsp&quot;/&gt;
<br>
 &nbsp; &nbsp; &nbsp;&lt;put name=&quot;submenu&quot; value=&quot;/pages/submenu/main/login.jsp&quot;/&gt;
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;put name=&quot;navigation&quot;
value=&quot;/pages/navigation/empty.jsp&quot;/&gt; <br>
 &nbsp; &lt;/definition&gt; <br>
 &nbsp; &nbsp;<br>
 &nbsp; &lt;definition name=&quot;dos.Welcome&quot; extends=&quot;dos.WelcomeLayout&quot;&gt;
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;put name=&quot;caption&quot;
value=&quot;/pages/captions/main/welcome.jsp&quot;/&gt; <br>
 &nbsp; &nbsp; &nbsp;&lt;put name=&quot;content&quot; value=&quot;/pages/mainpage/main/welcome.jsp&quot;/&gt;
<br>
 &nbsp; &lt;/definition&gt; <br>
... <br>
&lt;/tiles-definitions&gt;</font>
<br><font size=3>&nbsp;</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">That was written in the log-file:</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">DEBUG 2003-10-09 08:50:46,204 - Get module
name for path /action <br>
DEBUG 2003-10-09 08:50:46,204 - Module name found: default <br>
DEBUG 2003-10-09 08:50:46,205 - Processing a 'GET' for path '/welcome'
<br>
DEBUG 2003-10-09 08:50:46,205 - &nbsp;Looking for ActionForm bean instance
in scope 'request' under attribute key 'loginForm' <br>
DEBUG 2003-10-09 08:50:46,205 - &nbsp;Creating new ActionForm instance
of type 'test.forms.main.CLoginForm' <br>
DEBUG 2003-10-09 08:50:46,205 - &nbsp;--&gt; test.forms.main.CLoginForm@f507d2
<br>
DEBUG 2003-10-09 08:50:46,205 - &nbsp;Storing ActionForm bean instance
in scope 'request' under attribute key 'loginForm' <br>
DEBUG 2003-10-09 08:50:46,206 - &nbsp;Populating bean properties from this
request <br>
DEBUG 2003-10-09 08:50:46,206 - BeanUtils.populate(test.forms.main.CLoginForm@f507d2,
{}) <br>
DEBUG 2003-10-09 08:50:46,206 - &nbsp;Looking for Action instance for class
test.actions.CWelcomeAction <br>
DEBUG 2003-10-09 08:50:46,206 - &nbsp; Returning existing Action instance
<br>
DEBUG 2003-10-09 08:50:46,206 - Begin &nbsp; CWelcomeAction.execute() <br>
DEBUG 2003-10-09 08:50:46,206 - dispatch: ActionConfig[path=/welcome,name=loginForm,scope=request,type=test.actions.CWelcome
<br>
Action <br>
... <br>
DEBUG 2003-10-09 08:50:46,211 - End &nbsp; &nbsp; CWelcomeAction.execute()
<br>
DEBUG 2003-10-09 08:50:46,211 - processForwardConfig(dos.Welcome, false)
<br>
DEBUG 2003-10-09 08:50:46,212 - uri=/pages/layouts/dosDefaultLayout.jsp
doInclud <br>
e=false <br>
DEBUG 2003-10-09 08:50:46,214 - insert page='/pages/header/startpage.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,219 - insert page='/pages/mainmenu_bottom/welcomemain.
<br>
jsp'. <br>
DEBUG 2003-10-09 08:50:46,226 - insert page='/pages/submenu/main/login.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,230 - insert page='/pages/submenu/common/agb.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,236 - insert page='/pages/navigation/empty.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,238 - insert page='/pages/captions/main/welcome.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,240 - insert page='/pages/mainpage/main/welcome.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,242 - &nbsp; 'dos.Welcome' - processed as definition
<br>
<b><br>
THE SECOND ONE:</b></font>
<br><font size=2 face="Arial">DEBUG 2003-10-09 08:50:46,522 - Get module
name for path /action <br>
DEBUG 2003-10-09 08:50:46,522 - Module name found: default <br>
DEBUG 2003-10-09 08:50:46,523 - Processing a 'GET' for path '/welcome'
<br>
DEBUG 2003-10-09 08:50:46,523 - &nbsp;Looking for ActionForm bean instance
in scope ' <br>
request' under attribute key 'loginForm' <br>
DEBUG 2003-10-09 08:50:46,523 - &nbsp;Creating new ActionForm instance
of type 'test.forms.main.CLoginForm' <br>
DEBUG 2003-10-09 08:50:46,526 - &nbsp;--&gt; test.forms.main.CLoginForm@d4
<br>
a1d3 <br>
DEBUG 2003-10-09 08:50:46,526 - &nbsp;Storing ActionForm bean instance
in scope 'requ <br>
est' under attribute key 'loginForm' <br>
DEBUG 2003-10-09 08:50:46,526 - &nbsp;Populating bean properties from this
request <br>
DEBUG 2003-10-09 08:50:46,526 - BeanUtils.populate(test.forms.main <br>
.CLoginForm@d4a1d3, {}) <br>
DEBUG 2003-10-09 08:50:46,526 - &nbsp;Looking for Action instance for class
test.actions.CWelcomeAction <br>
DEBUG 2003-10-09 08:50:46,526 - &nbsp; Returning existing Action instance
<br>
DEBUG 2003-10-09 08:50:46,526 - Begin &nbsp; CWelcomeAction.execute() <br>
DEBUG 2003-10-09 08:50:46,526 - dispatch: ActionConfig[path=/welcome,name=loginF
<br>
orm,scope=request,type=test.actions.CWelcome <br>
Action <br>
... <br>
DEBUG 2003-10-09 08:50:46,548 - End &nbsp; &nbsp; CWelcomeAction.execute()
<br>
DEBUG 2003-10-09 08:50:46,550 - processForwardConfig(dos.Welcome, false)
<br>
DEBUG 2003-10-09 08:50:46,551 - uri=/pages/layouts/dosDefaultLayout.jsp
doInclud <br>
e=false <br>
DEBUG 2003-10-09 08:50:46,555 - insert page='/pages/header/startpage.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,562 - insert page='/pages/mainmenu_bottom/welcomemain.
<br>
jsp'. <br>
DEBUG 2003-10-09 08:50:46,577 - insert page='/pages/submenu/main/login.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,582 - insert page='/pages/submenu/common/agb.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,584 - insert page='/pages/navigation/empty.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,585 - insert page='/pages/captions/main/welcome.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,586 - insert page='/pages/mainpage/main/welcome.jsp'.
<br>
DEBUG 2003-10-09 08:50:46,587 - &nbsp; 'dos.Welcome' - processed as definition
</font>
<br><font size=3>&nbsp;</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">Has anyone an idea, where the mistake is?
I thing all my actions were executed twice.</font>
<br><font size=3>&nbsp;</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">Regards,</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 face="Arial">Frank</font>
<br>
--=_alternative 0049A092CA256DBA_=--