~ubuntu-branches/ubuntu/lucid/libstruts1.2-java/lucid

« back to all changes in this revision

Viewing changes to contrib/struts-faces/example1-webapp/src/web/registration.jsp

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-04-24 12:14:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060424121423-naev53qigqgks0sa
Tags: 1.2.9-1
New upstream  release Fixes  three security  problems: CVE-2006-1546,
CVE-2006-1547,  CVE-2006-1548  (closes:  #360551),  thanks  to  Moritz
Muehlenhoff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
 
2
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
 
3
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
 
4
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
 
5
<%@ taglib prefix="s" uri="http://struts.apache.org/tags-faces" %>
 
6
 
 
7
<!--
 
8
 
 
9
 Copyright 2002,2004 The Apache Software Foundation.
 
10
 
 
11
 Licensed under the Apache License, Version 2.0 (the "License");
 
12
 you may not use this file except in compliance with the License.
 
13
 You may obtain a copy of the License at
 
14
 
 
15
      http://www.apache.org/licenses/LICENSE-2.0
 
16
 
 
17
 Unless required by applicable law or agreed to in writing, software
 
18
 distributed under the License is distributed on an "AS IS" BASIS,
 
19
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
20
 See the License for the specific language governing permissions and
 
21
 limitations under the License.
 
22
 
 
23
-->
 
24
 
 
25
 
 
26
<f:view>
 
27
<s:loadMessages       var="messages"/>
 
28
<s:html            locale="true">
 
29
<head>
 
30
  <title><c:choose>
 
31
    <c:when          test="${registrationForm.action == 'Create'}">
 
32
      <s:message      key="registration.title.create"/>
 
33
    </c:when>
 
34
    <c:when          test="${registrationForm.action == 'Edit'}">
 
35
      <s:message      key="registration.title.edit"/>
 
36
    </c:when>
 
37
    <c:otherwise>
 
38
      UNKNOWN ACTION
 
39
    </c:otherwise>
 
40
  </c:choose></title>
 
41
  <s:base/>
 
42
  <s:stylesheet      path="/stylesheet.css"/>
 
43
</head>
 
44
<body>
 
45
 
 
46
<s:errors/>
 
47
 
 
48
<s:form                id="registration"
 
49
                   action="/saveRegistration"
 
50
                    focus="username"
 
51
                 onsubmit="return validateRegistrationForm(this);"
 
52
               styleClass="center form">
 
53
 
 
54
  <h:inputHidden       id="action"
 
55
                    value="#{registrationForm.action}"/>
 
56
 
 
57
  <h:panelGrid    columns="2"
 
58
               styleClass="grid"
 
59
              headerClass="grid header"
 
60
            columnClasses="grid column0,grid column1">
 
61
 
 
62
    <%-- Grid header element --%>
 
63
 
 
64
    <f:facet name="header">
 
65
      <h:panelGroup>
 
66
        <c:choose>
 
67
          <c:when    test="${registrationForm.action == 'Create'}">
 
68
           <s:message key="registration.header.create"/>
 
69
          </c:when>
 
70
          <c:when    test="${registrationForm.action == 'Edit'}">
 
71
           <s:message key="registration.header.edit"/>
 
72
          </c:when>
 
73
          <c:otherwise>
 
74
           <h:outputText
 
75
                       id="unknownActionTitle"
 
76
                    value="UNKNOWN ACTION"/>
 
77
          </c:otherwise>
 
78
        </c:choose>
 
79
      </h:panelGroup>
 
80
    </f:facet>
 
81
 
 
82
    <%-- Grid data elements --%>
 
83
 
 
84
    <h:outputLabel    for="username"
 
85
               styleClass="label">
 
86
      <s:message      key="prompt.username"/>
 
87
    </h:outputLabel>
 
88
 
 
89
    <h:panelGroup>
 
90
      <c:choose>
 
91
        <c:when      test="${registrationForm.action == 'Create'}">
 
92
          <h:inputText id="username"
 
93
                     size="16"
 
94
               styleClass="field"
 
95
                    value="#{registrationForm.username}"/>
 
96
        </c:when>
 
97
        <c:when      test="${registrationForm.action == 'Edit'}">
 
98
          <h:panelGroup
 
99
                       id="usernameGroup">
 
100
            <s:write
 
101
                   filter="true"
 
102
               styleClass="value"
 
103
                    value="#{registrationForm.username}"/>
 
104
            <h:inputHidden
 
105
                       id="username"
 
106
                    value="#{registrationForm.username}"/>
 
107
          </h:panelGroup>
 
108
        </c:when>
 
109
        <c:otherwise>
 
110
          <h:outputText
 
111
                       id="unknownActionMessage"
 
112
               styleClass="value"
 
113
                    value="UNKNOWN ACTION"/>
 
114
        </c:otherwise>
 
115
      </c:choose>
 
116
    </h:panelGroup>
 
117
 
 
118
    <h:outputLabel    for="password"
 
119
               styleClass="label">
 
120
      <s:message      key="prompt.password"/>
 
121
    </h:outputLabel>
 
122
 
 
123
    <h:inputText       id="password"
 
124
                     size="16"
 
125
               styleClass="field"
 
126
                    value="#{registrationForm.password}"/>
 
127
 
 
128
    <h:outputLabel    for="password2"
 
129
               styleClass="label">
 
130
      <s:message      key="prompt.password2"/>
 
131
    </h:outputLabel>
 
132
 
 
133
    <h:inputText       id="password2"
 
134
                     size="16"
 
135
               styleClass="field"
 
136
                    value="#{registrationForm.password2}"/>
 
137
 
 
138
    <h:outputLabel    for="fullName"
 
139
               styleClass="label">
 
140
      <s:message      key="prompt.fullName"/>
 
141
    </h:outputLabel>
 
142
 
 
143
    <h:inputText       id="fullName"
 
144
                     size="50"
 
145
               styleClass="field"
 
146
                    value="#{registrationForm.fullName}"/>
 
147
 
 
148
    <h:outputLabel    for="fromAddress"
 
149
               styleClass="label">
 
150
      <s:message      key="prompt.fromAddress"/>
 
151
    </h:outputLabel>
 
152
 
 
153
    <h:inputText       id="fromAddress"
 
154
                     size="50"
 
155
               styleClass="field"
 
156
                    value="#{registrationForm.fromAddress}"/>
 
157
 
 
158
    <h:outputLabel    for="replyToAddress"
 
159
               styleClass="label">
 
160
      <s:message      key="prompt.replyToAddress"/>
 
161
    </h:outputLabel>
 
162
 
 
163
    <h:inputText       id="replyToAddress"
 
164
                     size="50"
 
165
               styleClass="field"
 
166
                    value="#{registrationForm.replyToAddress}"/>
 
167
 
 
168
    <h:commandButton   id="submit"
 
169
                     type="SUBMIT"
 
170
               styleClass="submit"
 
171
                    value="#{messages['button.save']}"/>
 
172
 
 
173
    <h:panelGroup>
 
174
      <h:commandButton id="reset"
 
175
                     type="RESET"
 
176
               styleClass="reset"
 
177
                    value="#{messages['button.reset']}"/>
 
178
      <h:commandButton id="cancel"
 
179
                     type="SUBMIT"
 
180
               styleClass="cancel"
 
181
                  onclick="bCancel=true;"
 
182
                    value="#{messages['button.cancel']}"/>
 
183
    </h:panelGroup>
 
184
 
 
185
  </h:panelGrid>
 
186
 
 
187
</s:form>
 
188
 
 
189
<c:if test="${registrationForm.action == 'Edit'}">
 
190
 
 
191
<h:form id="subscriptions">
 
192
 
 
193
  <h:dataTable         id="table"
 
194
                  binding="#{registrationBacking.table}"
 
195
            columnClasses="list column left,list column left,list column center,
 
196
                           list column center,list column center"
 
197
              headerClass="list header"
 
198
               styleClass="wide list"
 
199
               rowClasses="list row even,list row odd"
 
200
                    value="#{user.subscriptions}"
 
201
                      var="subscription">
 
202
 
 
203
    <h:column          id="hostColumn">
 
204
      <f:facet       name="header">
 
205
        <s:message     id="hostHeader"
 
206
                      key="heading.host"/>
 
207
      </f:facet>
 
208
      <h:outputText    id="subhost"
 
209
               styleClass="value"
 
210
                    value="#{subscription.host}"/>
 
211
    </h:column>
 
212
 
 
213
    <h:column          id="usernameColumn">
 
214
      <f:facet       name="header">
 
215
        <s:message     id="usernameHeader"
 
216
                      key="heading.user"/>
 
217
      </f:facet>
 
218
      <h:outputText    id="subusername"
 
219
               styleClass="value"
 
220
                    value="#{subscription.username}"/>
 
221
    </h:column>
 
222
 
 
223
    <h:column          id="typeColumn">
 
224
      <f:facet       name="header">
 
225
        <s:message     id="typeHeader"
 
226
                      key="heading.type"/>
 
227
      </f:facet>
 
228
      <h:selectOneMenu id="type"
 
229
               styleClass="field"
 
230
                    value="#{subscription.type}">
 
231
        <f:selectItem
 
232
                itemValue="imap"
 
233
                itemLabel="IMAP Protocol"/>
 
234
        <f:selectItem
 
235
                itemValue="pop3"
 
236
                itemLabel="POP3 Protocol"/>
 
237
      </h:selectOneMenu>
 
238
<%--
 
239
      <h:outputText    id="subtype"
 
240
               styleClass="value"
 
241
                    value="#{subscription.type}"/>
 
242
--%>
 
243
    </h:column>
 
244
 
 
245
    <h:column          id="autoConnectColumn">
 
246
      <f:facet       name="header">
 
247
        <s:message     id="autoConnectHeader"
 
248
                      key="heading.autoConnect"/>
 
249
      </f:facet>
 
250
      <h:selectBooleanCheckbox
 
251
                       id="autoConnect"
 
252
               styleClass="field"
 
253
                    value="#{subscription.autoConnect}"/>
 
254
    </h:column>
 
255
 
 
256
    <h:column          id="actionColumn">
 
257
      <f:facet       name="header">
 
258
        <s:message     id="actionHeader"
 
259
                      key="heading.action"/>
 
260
      </f:facet>
 
261
      <h:commandButton id="delete"
 
262
               styleClass="submit"
 
263
                immediate="true"
 
264
                   action="#{registrationBacking.delete}"
 
265
                    value="#{messages['button.delete']}"/>
 
266
      <h:commandButton id="edit"
 
267
               styleClass="submit"
 
268
                immediate="true"
 
269
                   action="#{registrationBacking.edit}"
 
270
                    value="#{messages['button.edit']}"/>
 
271
    </h:column>
 
272
 
 
273
  </h:dataTable>
 
274
 
 
275
  <h:commandButton     id="create"
 
276
                immediate="true"
 
277
                   action="#{registrationBacking.create}"
 
278
               styleClass="submit"
 
279
                    value="#{messages['button.add']}"/>
 
280
 
 
281
  <h:commandButton      id="update"
 
282
                 immediate="false"
 
283
                    action="#{registrationBacking.update}"
 
284
                styleClass="submit"
 
285
                     value="#{messages['button.update']}"/>
 
286
 
 
287
</h:form>
 
288
 
 
289
</c:if>
 
290
 
 
291
<s:javascript    formName="registrationForm"
 
292
        dynamicJavascript="true"
 
293
         staticJavascript="false"/>
 
294
<script language="Javascript1.1" src="staticJavascript.jsp"></script>
 
295
 
 
296
</body>
 
297
</s:html>
 
298
</f:view>