AW: struts double action execution!?
"Otto, Frank" <[email protected]> Thu, 9 Oct 2003 16:07:46 +0200
| Newsgroups | gmane.comp.java.mvc.devel |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C38E6E.B732EAA0
Content-Type: text/plain
Thanks for your answer.
No, I have no sub-class. In struts-config.xml there is only this entry:
<controller
contentType="text/html;charset=ISO-8859-1"
debug="3"
locale="true"
nocache="true"
maxFileSize="2M" />
Regards,
Frank
-----Ursprungliche Nachricht-----
Von: [email protected] [mailto:[email protected]]
Gesendet: Donnerstag, 9. Oktober 2003 15:30
An: [email protected]
Betreff: Re: [MVC-Programmers] struts double action execution!?
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
------_=_NextPart_001_01C38E6E.B732EAA0
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff size=2>Thanks
for your answer.</FONT></SPAN></DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff size=2>No, I
have no sub-class. In struts-config.xml there is only this
entry:</FONT></SPAN></DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff
size=2><controller<BR>
contentType="text/html;charset=ISO-8859-1"<BR>
debug="3"<BR> locale="true"<BR>
nocache="true"<BR> maxFileSize="2M" /></FONT></SPAN></DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff
size=2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=308500814-09102003><FONT face=Arial color=#0000ff
size=2>Frank</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B>
[email protected] [mailto:[email protected]]<BR><B>Gesendet:</B>
Donnerstag, 9. Oktober 2003 15:30<BR><B>An:</B>
[email protected]<BR><B>Betreff:</B> Re: [MVC-Programmers] struts
double action execution!?<BR><BR></FONT></DIV><BR><FONT face=sans-serif
size=2>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
face=sans-serif size=2>Cheers,</FONT> <BR><BR><FONT face=sans-serif
size=2>Kristen.</FONT> <BR><FONT face=sans-serif size=2>--<BR>Kristen
Gillard<BR>Multitask Consulting Pty Ltd<BR>Lvl 8, 20 Loftus
Street,<BR>Circular Quay, NSW, 2000<BR>--<BR>Ph: 61-2-9252-1462<BR>Fx:
61-2-9252-4636<BR>Mo:
0409-000-123<BR>--<BR>http://www.multitask.com.au/</FONT> <BR><BR><BR>
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD width="40%"><FONT face=sans-serif size=1><B>"Otto, Frank"
<[email protected]></B> </FONT><BR><FONT face=sans-serif
size=1>Sent by: [email protected]</FONT>
<P><FONT face=sans-serif size=1>09/10/2003 10:37 PM</FONT>
<TABLE border=1>
<TBODY>
<TR vAlign=top>
<TD bgColor=white>
<DIV align=center><FONT face=sans-serif size=1>Please respond
to<BR>[email protected]</FONT></DIV></TR></TBODY></TABLE><BR></P>
<TD width="59%">
<TABLE width="100%">
<TBODY>
<TR>
<TD>
<DIV align=right><FONT face=sans-serif size=1>To</FONT></DIV>
<TD vAlign=top><FONT face=sans-serif
size=1>"'[email protected]'"
<[email protected]></FONT>
<TR>
<TD>
<DIV align=right><FONT face=sans-serif size=1>cc</FONT></DIV>
<TD vAlign=top>
<TR>
<TD>
<DIV align=right><FONT face=sans-serif size=1>Subject</FONT></DIV>
<TD vAlign=top><FONT face=sans-serif size=1>[MVC-Programmers]
struts double action execution!?</FONT></TR></TBODY></TABLE><BR>
<TABLE>
<TBODY>
<TR vAlign=top>
<TD>
<TD></TR></TBODY></TABLE><BR></TR></TBODY></TABLE><BR><BR><BR><FONT face=Arial
size=2>Hello,</FONT> <BR><FONT size=3> </FONT> <BR><FONT face=Arial
size=2>I have a difficult problem. My action was executed twice and I don't
know why.</FONT> <BR><FONT size=3> </FONT> <BR><FONT face=Arial
size=2>There is a global forward in my main.jsp:</FONT> <BR><FONT
size=3> </FONT> <BR><FONT face=Arial size=2><%@ taglib
uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <BR><logic:forward
name="startpage"/> </FONT><BR><FONT size=3> </FONT> <BR><FONT
size=3> </FONT> <BR><FONT face=Arial
size=2><B>struts-config.xml:</B></FONT> <BR><FONT size=3> </FONT>
<BR><FONT face=Arial size=2><struts-config>
<BR> <global-forwards> <BR> <forward <BR>
name="startpage" <BR> path="/action/welcome"
/> <BR><BR> ... <BR> </global-forwards>
<BR><BR> <action-mappings> <BR> <BR> <action
<BR> path="/welcome" <BR>
type="test.actions.CWelcomeAction" <BR>
name="loginForm" <BR> scope="request" <BR>
validate="false"> <BR> <forward
<BR> name="Success" path="dos.Welcome" />
<BR> </action> <BR><BR> ...
<BR> </action-mappings> </FONT><BR><FONT size=3> </FONT>
<BR><FONT face=Arial size=2><B>tiles-def.xml:</B></FONT> <BR><FONT
size=3> </FONT> <BR><FONT face=Arial size=2><tiles-definitions>
<BR> <definition name="dos.DefaultLayout"
page="/pages/layouts/dosDefaultLayout.jsp"> <BR>
<put name="header" value="/pages/header/empty.jsp"/>
<BR> <put name="agb"
value="/pages/submenu/common/agb.jsp"/> <BR> </definition>
<BR> <BR> <definition name="dos.WelcomeLayout"
extends="dos.DefaultLayout">
<BR>
<put name="header" value="/pages/header/startpage.jsp"/>
<BR> <put name="mainmenu_top"
value="/pages/mainmenu_top/emptymain.jsp"/> <BR> <put
name="mainmenu_bottom" value="/pages/mainmenu_bottom/welcomemain.jsp"/>
<BR> <put name="submenu"
value="/pages/submenu/main/login.jsp"/> <BR>
<put name="navigation"
value="/pages/navigation/empty.jsp"/> <BR> </definition>
<BR> <BR> <definition name="dos.Welcome"
extends="dos.WelcomeLayout"> <BR>
<put name="caption"
value="/pages/captions/main/welcome.jsp"/> <BR> <put
name="content" value="/pages/mainpage/main/welcome.jsp"/> <BR>
</definition> <BR>... <BR></tiles-definitions></FONT> <BR><FONT
size=3> </FONT> <BR><FONT size=3> </FONT> <BR><FONT face=Arial
size=2>That was written in the log-file:</FONT> <BR><FONT size=3> </FONT>
<BR><FONT face=Arial size=2>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 - Looking for ActionForm
bean instance in scope 'request' under attribute key 'loginForm' <BR>DEBUG
2003-10-09 08:50:46,205 - Creating new ActionForm instance of type
'test.forms.main.CLoginForm' <BR>DEBUG 2003-10-09 08:50:46,205 - -->
test.forms.main.CLoginForm@f507d2 <BR>DEBUG 2003-10-09 08:50:46,205 -
Storing ActionForm bean instance in scope 'request' under attribute key
'loginForm' <BR>DEBUG 2003-10-09 08:50:46,206 - 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 - Looking for Action instance for class
test.actions.CWelcomeAction <BR>DEBUG 2003-10-09 08:50:46,206 -
Returning existing Action instance <BR>DEBUG 2003-10-09 08:50:46,206 - Begin
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
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 - 'dos.Welcome' - processed as definition
<BR><B><BR>THE SECOND ONE:</B></FONT> <BR><FONT face=Arial size=2>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 - Looking for ActionForm bean instance in scope '
<BR>request' under attribute key 'loginForm' <BR>DEBUG 2003-10-09 08:50:46,523
- Creating new ActionForm instance of type 'test.forms.main.CLoginForm'
<BR>DEBUG 2003-10-09 08:50:46,526 - --> test.forms.main.CLoginForm@d4
<BR>a1d3 <BR>DEBUG 2003-10-09 08:50:46,526 - Storing ActionForm bean
instance in scope 'requ <BR>est' under attribute key 'loginForm' <BR>DEBUG
2003-10-09 08:50:46,526 - 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 - Looking
for Action instance for class test.actions.CWelcomeAction <BR>DEBUG 2003-10-09
08:50:46,526 - Returning existing Action instance <BR>DEBUG 2003-10-09
08:50:46,526 - Begin 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 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 - 'dos.Welcome' - processed as definition </FONT><BR><FONT
size=3> </FONT> <BR><FONT size=3> </FONT> <BR><FONT face=Arial
size=2>Has anyone an idea, where the mistake is? I thing all my actions were
executed twice.</FONT> <BR><FONT size=3> </FONT> <BR><FONT
size=3> </FONT> <BR><FONT face=Arial size=2>Regards,</FONT> <BR><FONT
size=3> </FONT> <BR><FONT face=Arial size=2>Frank</FONT>
<BR></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C38E6E.B732EAA0--