Project

General

Profile

1
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
2
<%@ taglib uri="/tags/struts-html" prefix="html" %>
3
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
4
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
5
<%@ page import="org.apache.struts.action.*" %>
6

    
7
<logic:notEmpty name="menuForwards">
8
  <table class="menu">
9
    <tbody>
10
<%  // Access menuForwards - could not figure out how to with tags
11
    String forwards = (String) request.getAttribute("menuForwards");
12
    String[] array = forwards.split(":"); 
13
    for (int index = 0; index < array.length; index ++) {
14
%>
15
      <tr>
16
        <td>
17
<%  String forward = array[ index ];
18
    if( forward.length() == 0 ){
19
%>
20
          <hr/>
21
<%  }
22
    else if (forward.startsWith("/")) {
23
        String action = forward.substring(1);
24
%>
25
          <html:link style="item"
26
                     action="<%= action %>">
27
            <%= action %>
28
          </html:link>
29
<%  }
30
    else {
31
%>              
32
          <html:link style="item"
33
                     forward="<%= forward %>"
34
                     titleKey="<%= forward+".short" %>">
35
            <bean:message key="<%= forward+".label" %>"/>
36
          </html:link>
37
<%  }
38
%>          
39
        </td>
40
      </tr>
41
<%  } %>
42
    </tbody>
43
  </table>
44
</logic:notEmpty>
(20-20/26)