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