File: bean-write-2.jsp

package info (click to toggle)
libstruts1.2-java 1.2.9-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 47,516 kB
  • ctags: 29,430
  • sloc: xml: 90,344; java: 71,078; jsp: 31,692; makefile: 10; sh: 2
file content (125 lines) | stat: -rw-r--r-- 3,838 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html>
  <head>
    <title>Test struts-bean:write Tag</title>
  </head>
  <body>
    <div align="center">
      <h1>Test struts-bean:write Tag</h1>
    </div>
    <h3>Test 7 - Localized format patterns</h3><%
      pageContext.setAttribute("test7.double", new Double(1234567.89));
      pageContext.setAttribute("test7.date", new java.util.Date(123456789));
    %>
    <h4>Doubles</h4>
    <table border="0">
      <tr>
        <td>
          <table border="1">
            <tr>
              <th>Language</th>
              <th>Double format</th>
            </tr>
            <tr>
              <td>de 
              <bean:message key="locale.de" /></td>
              <td>1.234.567,89</td>
            </tr>
            <tr>
              <td>en 
              <bean:message key="locale.en" /></td>
              <td>1,234,567.89</td>
            </tr>
            <tr>
              <td>fr 
              <bean:message key="locale.fr" /></td>
              <td>1 234 567,89</td>
            </tr>
          </table>
        </td>
        <td>
          <table border="1">
            <tr>
              <th>Default format</th>
              <th>Using Format Attribute</th>
              <th>Using Format Key</th>
            </tr>
            <tr>
              <td>
                <%= pageContext.getAttribute("test7.double") %>
              </td>
              <td>[#,000.00] 
              <bean:write name="test7.double" format="#,000.00" /></td>
              <td>[
              <bean:message key="double.pattern" />] 
              <bean:write name="test7.double" formatKey="double.pattern" /></td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <h4>Dates</h4>
    <table border="0">
      <tr>
        <td>
          <table border="1">
            <tr>
              <th>Language</th>
              <th>Date format</th>
            </tr>
            <tr>
              <td>de 
              <bean:message key="locale.de" /></td>
              <td>Fr, Jan 2, '70</td>
            </tr>
            <tr>
              <td>en 
              <bean:message key="locale.en" /></td>
              <td>Fri, Jan 2, '70</td>
            </tr>
            <tr>
              <td>fr 
              <bean:message key="locale.fr" /></td>
              <td>ven., janv. 2, '70</td>
            </tr>
          </table>
        </td>
        <td>
          <table border="1">
            <tr>
              <th>Default format</th>
              <th>Using Format Attribute</th>
              <th>Using Format Key</th>
            </tr>
            <tr>
              <td>
                <%= pageContext.getAttribute("test7.date") %>
              </td>
              <td>[EEE, MMM d, ''yy] 
              <bean:write name="test7.date" format="EEE, MMM d, ''yy" /></td>
              <td>[
              <bean:message key="date.pattern" />] 
              <bean:write name="test7.date" formatKey="date.pattern" /></td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <h4>Sprache | Language | Langage</h4>
    <ul>
      <li>
        <html:link action="/locale?page=/bean-write-2.jsp&amp;language=de">German | Deutsch</html:link>
        <bean:message key="locale.de" />
      </li>
      <li>
        <html:link action="/locale?page=/bean-write-2.jsp&amp;language=en">English | Anglais</html:link>
        <bean:message key="locale.en" />
      </li>
      <li>
        <html:link action="/locale?page=/bean-write-2.jsp&amp;language=fr">French | Francais</html:link>
        <bean:message key="locale.fr" />
      </li>
    </ul>
  </body>
</html>