Sorry, I've wrote too fast :
the action, into the menu-config.xml doesn't take a / caracter.
It must be :

<Menu name="menu1" title="Accueil" width="150">
        <Item name="presentation" title="Presentation" action="pres" />
        <Item name="coordonnees" title="Coordonnées" action="coor" />      
</Menu>





dams a écrit :

>Yes, it works, I've find the solution (after lots of try).
>So, I think I need explain, because there's lot of people as I can see
>which have problems to use struts-menu with tiles, like me.
>The solution is so simple...
>
>Just we need to create an action mapping for each tiles definition, then
>we can call them with the action parameter of the menu-config.
>
>So, for exemple, in the struts-config.xml I put the actions like these :
>
><action-mappings>
> 
><action path="/coor" type="org.apache.struts.actions.ForwardAction"
>parameter="coordonnees" />
> <action path="/pres" type="org.apache.struts.actions.ForwardAction" 
>parameter="presentation" />
>
></action-mappings>
>
>where the "parameter" is the name of the tile definition (which is in
>tiles-defs.xml)
>
>And then, I just need to call them into the menu-config.xml like that :
>
><Menu name="menu1" title="Accueil" width="150">
>        <Item name="presentation" title="Presentation" action="/pres" />
>        <Item name="coordonnees" title="Coordonnées" action="/coor" />      
></Menu>
>
>
>That's all folks.
>
>Now I can see how much struts is really more cool than php. Just
>beginners need more good tuto to start with menu links and struts
>actions I think. But now it's okay.
>
>Thanks.
>
>  
>
>>Hi,
>>
>>I use struts-menu with tiles, in a layout website tiles in two part : a
>>menu (struts-menu) at right and a page at left. Classical, nothing
>>complicated in theory.
>>The menu works fine, I mean, it appears fine.
>>The first page too, fine.
>>Just the links between menus and pages doesn't works, cause I did'nt
>>understand, so I need help ifnot I return to php (I'm a newbee with
>>struts and J2EE things).
>>
>>Well, this is my files :
>>a) a part of the menu-config.xml
>><Menus>
>><Menu name="menu1" title="Accueil" width="150">
>>       <Item name="equipe" title="Equipe">
>>               <Item name="Dir" title="Directeur />
>>       </Item>
>>       <Item name="intranet" title="Acces restreint" action=""
>>location=""/>
>>       <Item name="coordonnees" title="Coordonnées" action="/page"
>>/>      
>></Menu>
>><Menu name="menu2" title="Chimie de coordination" location="" >
>></Menu>
>><Menu name="menu3" title="Chimie du solide" location="">
>></Menu>
>></Menus>
>>
>>b) A part of the tiles-defs.xml :
>><tiles-definitions>
>>       <definition name="baseDef" path="/includes/pageStructure.jsp">
>>               <put name="title" content="Website" />
>>               <put name="menu" value="/menu/menu.jsp" />
>>               <put name="fond" content="/images/fond.png" />
>>       </definition>
>>       <definition name="presentation" extends="baseDef">
>>               <put name="page" value="/pages/accueil/presentation.jsp" />
>>               <put name="titre" content="Présentation" />
>>       </definition>
>>       <definition name="coordonnees" extends="baseDef">
>>               <put name="page" page="/pages/accueil/coordonnees.jsp"/>
>>               <put name="titre" content="Coordonnées" />
>>       </definition>
>></tiles-definitions>
>>
>>c) A part of the struts-config.xml
>><action-mappings>
>>        <action    path="/index"             
>>type="org.apache.struts.actions.ForwardAction">
>>             <forward name='page' path='/index.jsp' redirect='false'/>
>>        </action>
>>        <action    path="/page"               
>>type="org.apache.struts.actions.ForwardAction" >
>>               <forward name="coordonnees" path="coordonnees" />
>>        </action>
>>        <action   path="/change"
>>               forward="/includes/pageStructure.jsp">
>>       </action>
>>      <action    path="/admin/tiles/reload"     
>>type="org.apache.struts.tiles.actions.ReloadDefinitionsAction"/>
>>       <action    path="/admin/tiles/view"               
>>type="org.apache.struts.tiles.actions.ViewDefinitionsAction"/>
>></action-mappings>
>>
>>d) The fist layout is showing with these line into the index.jsp :
>><tiles:insert definition="presentation" flush="true" />
>>
>>And now my questions :
>>1) How can I link menus with tiles definitions ? For exemple to change
>>the page "presentation" to the page "Coordonnées" ?
>>
>>2) How can I make good actions wich works fine, without doing java class
>>if possible.
>>
>>3) Is there somewhere a good and easy tutorial ? I've looking on the net
>>and on the examples and I've not find good explains.
>>The user-guide doesn't explain how to link menus with pages contents.
>>
>>Thanks
>>
>>-------------------------------------------------------------------------
>>Using Tomcat but need to do more? Need to support web services, security?
>>Get stuff done quickly with pre-integrated technology to make your job easier
>>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>_______________________________________________
>>struts-menu-user mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/struts-menu-user
>>
>> 
>>
>>    
>>
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>struts-menu-user mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/struts-menu-user
>
>  
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
struts-menu-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user

Reply via email to