tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stetze2008 <stetze2...@gmx.de>
Subject Re: Problem with Struts 2 + Tiles 2 + Validation (result input)
Date Mon, 26 May 2008 07:25:26 GMT
Antonio Petrelli wrote:
> 2008/5/24 Stetze2008 <stetze2008@gmx.de>:
>   
>>       <result name="error" type="tiles">page.user.profile</result>
>>       <result name="input" type="tiles">page.user.profile</result>
>>     
>
> It seems that you have the same Tiles definition for the "input" and
> the "error" results. Probably you need to define one different
> definition for error.
>
> Antonio
>
>   
Thanks for your reply but defining different tiles definitions for the 
input and error result did not help.
The problem is that if the action editProfile returns a validation error 
it uses the tiles definition page.user.profile defined for the result 
input of this action.

But the definition page.user.profile extends the tiles definition 
base.definition and in this base definition another action 
(/menu/module.action) is called to determine the correct top module to 
be shown. Now it seems that this action is not invoked but also for this 
action the definition defined for the result input is shown (in this 
case the login.jsp what is definitely wrong when the user is logged in)

I would be glad if somebody of you could give me another hint!

tiles.xml:
<definition name="base.definition" template="/layouts/wmBoerseLayout.jsp">
       <put-attribute name="module" value="/menu/module.action"/>
       <put-attribute name="std_menu" value="/common/menu.jsp" />
</definition>

<definition name="page.user.profile" extends="base.definition">
       <put-attribute name="body-content" value="/pages/profile.jsp"/>
</definition>

struts.xml:
<action name="module" class="userAction" method="module">
       <interceptor-ref name="myStack"/>
       <result name="user">/modules/user.jsp</result>
       <result name="admin">/modules/admin.jsp</result>
       <result name="login">/modules/login.jsp</result>
       <result name="input">/modules/login.jsp</result>
       <result>/modules/login.jsp</result>
</action>

<action name="editProfile" class="profileAction" method="editProfile">
       <result type="tiles">page.user.profile</result>
       <result name="error" type="tiles">page.user.profile</result>
       <result name="input" type="tiles">page.user.profile</result>
</action>

Mime
View raw message