You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Je...@nlgroup.ca on 2002/10/30 17:54:03 UTC

[Tiles] Getting wrong page definition when Struts does auto validation.

I have  converted most of my developing application to Tiles with great
success, but I have just found a error that I hope somone
could help me with. It apears to me  to be a bug because I think I have it
configured properly.

I am using 1.1b2 with tomcat 4.0.4

Most of my pages will extend one page layout definition, but several use an
alternate page layout.
I will post the config code below, here is a summary:
My two layouts are:

 <definition name="masterLayout" path="/WEB-INF/common/MainLayoutPage.jsp">
and
<definition name="masterWideLayout" path="/WEB-INF/common/MainLayoutWideContentPage.jsp">

then
<definition name="customer.master" extends="masterLayout" >
and
<definition name="customer.wide.master" extends="masterWideLayout" >

I have a page definition:
 <definition name="view.mesh.main" extends="customer.wide.master" >

When I  let Struts call the validate method and route back to my LoadAction the page displays the error messages but the page is displayed
using the masterLayout definition.

I hope I have provided the proper info....
----------------------------------------------------------------------------------
Page definiition in  xml file:
<definition name="masterLayout" path="/WEB-INF/common/MainLayoutPage.jsp">
    <put name="footer" value="/WEB-INF/common/PageFooter.jsp" />
    <put name="messageTable"   value="/WEB-INF/common/MessageTable.jsp" />
    <put name="headerMenu" value="/WEB-INF/common/HeaderMenu.jsp" />
  </definition>

  <definition name="masterWideLayout" path="/WEB-INF/common/MainLayoutWideContentPage.jsp">
        <put name="footer" value="/WEB-INF/common/PageFooter.jsp" />
    <put name="messageTable"   value="/WEB-INF/common/MessageTable.jsp" />
    <put name="headerMenu" value="/WEB-INF/common/HeaderMenu.jsp" />
  </definition>


  <!-- The top definitions for the customer pages -->
   <definition name="customer.master" extends="masterLayout" >
        <put name="sideMenu" value="/WEB-INF/customer/table/CustomerMenu.jsp" />
   </definition>

   <definition name="customer.wide.master" extends="masterWideLayout" >
        <put name="sideMenu" value="/WEB-INF/customer/table/CustomerMenu.jsp" />
   </definition>

    <!-- **************** Mesh Views ******************
    Note that this uses the wide layout definition
    -->
    <definition name="view.mesh.main" extends="customer.wide.master" >
        <put name="title"  value="Transaction Meshing" />
        <put name="header" value="/WEB-INF/common/PageHeader.jsp?pageTitle=Transaction Meshing" />
       <put name="summary" value="/WEB-INF/customer/form/CurrentCustomerSummaryForm.jsp?actionTarget=/meshChangeCurrentCustomer.do" />
       <put name="mainContent" value="/WEB-INF/customer/table/CustomerMeshMainTable.jsp" />
       <put name="wideContent" value="/WEB-INF/customer/form/CustomerMeshMainForm.jsp" />
    </definition>
    <!-- ************************************************-->

Struts config Info:
<action path="/meshLoad"
        type="com.nlg.ar.web.customer.action.CustomerMeshingLoadAction"
         name="customerMeshingForm"
        scope="request"
        validate="false">
     <forward name="success" path="view.mesh.main" />
  </action>

<action
      path="/meshAction"
      type="com.nlg.ar.web.customer.action.CustomerMeshAction"
      name="customerMeshingForm"
      scope="request"
      validate="true"
      input="/meshLoad.do">
     <forward name="success" path="/meshLoad.do" />
  </action>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Tiles] Getting wrong page definition when Struts does auto validation.

Posted by Cedric Dumoulin <ce...@apache.org>.
  Looks like there is a problem.
  Does "meshAction.do" use the correct layout when there is no error ? 
If yes, there is something wrong when validate reroute the request.

       Cedric

Jeff_Mychasiw@nlgroup.ca wrote:

>I have  converted most of my developing application to Tiles with great
>success, but I have just found a error that I hope somone
>could help me with. It apears to me  to be a bug because I think I have it
>configured properly.
>
>I am using 1.1b2 with tomcat 4.0.4
>
>Most of my pages will extend one page layout definition, but several use an
>alternate page layout.
>I will post the config code below, here is a summary:
>My two layouts are:
>
> <definition name="masterLayout" path="/WEB-INF/common/MainLayoutPage.jsp">
>and
><definition name="masterWideLayout" path="/WEB-INF/common/MainLayoutWideContentPage.jsp">
>
>then
><definition name="customer.master" extends="masterLayout" >
>and
><definition name="customer.wide.master" extends="masterWideLayout" >
>
>I have a page definition:
> <definition name="view.mesh.main" extends="customer.wide.master" >
>
>When I  let Struts call the validate method and route back to my LoadAction the page displays the error messages but the page is displayed
>using the masterLayout definition.
>
>I hope I have provided the proper info....
>----------------------------------------------------------------------------------
>Page definiition in  xml file:
><definition name="masterLayout" path="/WEB-INF/common/MainLayoutPage.jsp">
>    <put name="footer" value="/WEB-INF/common/PageFooter.jsp" />
>    <put name="messageTable"   value="/WEB-INF/common/MessageTable.jsp" />
>    <put name="headerMenu" value="/WEB-INF/common/HeaderMenu.jsp" />
>  </definition>
>
>  <definition name="masterWideLayout" path="/WEB-INF/common/MainLayoutWideContentPage.jsp">
>        <put name="footer" value="/WEB-INF/common/PageFooter.jsp" />
>    <put name="messageTable"   value="/WEB-INF/common/MessageTable.jsp" />
>    <put name="headerMenu" value="/WEB-INF/common/HeaderMenu.jsp" />
>  </definition>
>
>
>  <!-- The top definitions for the customer pages -->
>   <definition name="customer.master" extends="masterLayout" >
>        <put name="sideMenu" value="/WEB-INF/customer/table/CustomerMenu.jsp" />
>   </definition>
>
>   <definition name="customer.wide.master" extends="masterWideLayout" >
>        <put name="sideMenu" value="/WEB-INF/customer/table/CustomerMenu.jsp" />
>   </definition>
>
>    <!-- **************** Mesh Views ******************
>    Note that this uses the wide layout definition
>    -->
>    <definition name="view.mesh.main" extends="customer.wide.master" >
>        <put name="title"  value="Transaction Meshing" />
>        <put name="header" value="/WEB-INF/common/PageHeader.jsp?pageTitle=Transaction Meshing" />
>       <put name="summary" value="/WEB-INF/customer/form/CurrentCustomerSummaryForm.jsp?actionTarget=/meshChangeCurrentCustomer.do" />
>       <put name="mainContent" value="/WEB-INF/customer/table/CustomerMeshMainTable.jsp" />
>       <put name="wideContent" value="/WEB-INF/customer/form/CustomerMeshMainForm.jsp" />
>    </definition>
>    <!-- ************************************************-->
>
>Struts config Info:
><action path="/meshLoad"
>        type="com.nlg.ar.web.customer.action.CustomerMeshingLoadAction"
>         name="customerMeshingForm"
>        scope="request"
>        validate="false">
>     <forward name="success" path="view.mesh.main" />
>  </action>
>
><action
>      path="/meshAction"
>      type="com.nlg.ar.web.customer.action.CustomerMeshAction"
>      name="customerMeshingForm"
>      scope="request"
>      validate="true"
>      input="/meshLoad.do">
>     <forward name="success" path="/meshLoad.do" />
>  </action>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>