Thanks for your answer. I don't use sub-applications.
I would like to organize my Struts application into several sub-applications

but I don't have a lot of time to develop my application. 
I am scared to loose time to implement this new feature. I am convinced that
I will need of this architecture in the future.
If you have a simple example of sub-applications (with multiple
struts-config files,
source code directory organisation), I am very very interested. I will be
lucky to
use sub-applications in my first version.

About tiles-menu sub-items, I thought that it was more easy, and that we can
do
it with declaration.
I don't understand very well your solution, you place your code in the JSP
page but
in my page I have the following lines:
<tiles:insert page="/layouts/classicLayout.jsp" flush="true">
  <tiles:put name="title"  value="Tiles Basic Page" />
  <tiles:put name="header" value="/tiles/common/header.jsp" />
  <tiles:put name="footer" value="/tiles/common/footer.jsp" />
  <tiles:put name="menu"   value="/tiles/simpleMenu.jsp" />

I don't give information about sub-items of the menu and I use message keys
for Home or Member in order to do internationalisation.
Have you really use JSTL Core with Tiles components ?
Is it the unique solution to customize the menu for each page ?


-----Original Message-----
From: Eddie Bush [mailto:[EMAIL PROTECTED]]
Sent: 16 September 2002 20:20
To: Struts Users Mailing List
Subject: Re: Tiles question - menu items


If you're using sub-applications, you could use the bean tags to get a 
bean indicating which module you're in.  From there, just use a 
<c:choose> from the JSTL.  I've implemented a similar solution, and it 
works great.  The only part I don't like is having to use a RTE in order 
to build the bean refering to the module I'm in.  I do this:

<%@ taglib prefix="bean" uri="/tags/struts-bean" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<bean:define id="prefix" name="<%= 
org.apache.struts.action.Action.APPLICATION_KEY %>" property="prefix"/>

That gives me the "prefix" of the module (empty for the default and 
/<module> for each module).  Then, you can use the power of the JSTL to do:

      <c:choose>
        <c:when test='${empty prefix}'>
          Home
        </c:when>
        <c:otherwise>
          <html:link forward='toDefault'>Home</html:link>
        </c:otherwise>
      </c:choose>

      <c:choose>
        <c:when test='${prefix == "/member"}'>
          Member
        </c:when>
        <c:otherwise>
          <html:link forward='toMember'>Member</html:link>
        </c:otherwise>
      </c:choose>

Does that shed some light?

Regards,

Eddie

Heligon Sandra wrote:

>       I defined a menu bar as Tiles attribute,
>       the menu contains several sub-elements Home, Admin, Login, Help.
>       
>       When we are on the Admin page the Admin element has not to be
>       available in the menu bar, we have to customize the menu for each
>page.
>
>       We will not define a menu.jsp for each page, how is it possible for
>       a page to indicate only the sub-elements available ?
>
>       Thanks a lot
>
>--
>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to