You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Emi Lu <em...@encs.concordia.ca> on 2009/12/23 18:27:16 UTC
Dispatch does not work ( Struts2 + tile)
Hello all,
I am using struts2.1.8.1 & tiles2.0.7.
The following doc says that dispatch will work, but when I setup:
http://www.vaannila.com/struts-2/struts-2-example/dispatchAction-in-struts-2-example-1.html
My page goes to the correct URL, but the action class "ProcessTest" is
not called at all; only after refresh the page, the "edit" function is
called. Someone knows why and how?
My configurations are:
===========================
(1) jsp
<s:form namespace="/Edit" action="ProcessTest">
... ...
<s:submit value="Edit" theme="simple" action="edit">
</s:form>
(2) struts.xml
<package name="Edit" namespace="/Edit" extends="struts-default">
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
<action name="editProcessTest" class="ProcessTest" method="edit">
<result name="input" type="tiles">edit_it </result>
<result name="error" type="tiles">browse_it </result>
</action>
(3) In Tiles
<definition name= "edit_degname"
template="/WEB-INF/layouts/mainLayout-page.jsp">
<put-attribute name="title" value="Edit" />
<put-attribute name="body" value="/WEB-INF/p1.jsp" />
</definition>
After clicking (1)."Edit", browser goes to /Edit/ProcessTest, but the
method "edit" in ProcessTest.java class never being called?
Thank you for your help!
--
Lu Ying
Re: Dispatch does not work ( Struts2 + tile)
Posted by Wes Wannemacher <we...@wantii.com>.
On Wed, Dec 23, 2009 at 12:27 PM, Emi Lu <em...@encs.concordia.ca> wrote:
> (1) jsp
> <s:form namespace="/Edit" action="ProcessTest">
[snip]
> <action name="editProcessTest" class="ProcessTest" method="edit">
That form doesn't look like it is calling the action... Your action is
named 'editProcessTest', but the form points to 'ProcessTest'. Are
there more pieces (spring configuration, etc.) that we need to see?
-Wes
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org