FormPage.jsp Sample
This topic inludes the source code for the FormPage.jsp Sample.
Sample Location
This sample is located in the following directory in your WebLogic Workshop installation:
BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/struts/validation/basic/
Sample Source Code
01 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
02 <%@ taglib uri="netui-tags-html.tld" prefix="netui" %>
03
04
05 <html>
06 <head>
07 <netui:base/>
08 <title>Basic Form Validation with Page Flows: Form Page</title>
09 <link href="../../../resources/css/style.css" type="text/css" rel="stylesheet"/>
10 </head>
11
12 <body>
13
14 <jsp:include page="/resources/jsp/header.jsp"/> <br/>
15
16 <blockquote>
17
18 <h3>Basic Form Validation with Page Flows</h3>
19 <h4>Form Page</h4>
20
21 <p>The validation for this form's fields is very basic. However, by keeping the
22 validation rules simple, we can focus on how:
23
24 <ul type="square">
25 <li>The ActionErrors() method in the page flow was used.</li>
26 <li>Error text came from the Messages.properties file in
27 /WEB-INF/classes/basic.</li>
28 </ul>
29
30 <netui:form action="submitForm">
31 <table>
32 <tr>
33 <td><p>Enter E-mail Address:</p></td>
34 <td>
35 <netui:textBox dataSource="{actionForm.email}"/>
36 </td>
37 <td>
38 <netui:error value="email"/>
39 </td>
40 </tr>
41
42 <tr>
43 <td><p>Enter 5-digit Zip Code:</p></td>
44 <td>
45 <netui:textBox dataSource="{actionForm.zipCode}"/>
46 </td>
47 <td>
48 <netui:error value="zipCode"/>
49 </td>
50 </tr>
51 </table>
52
53 <netui:button>Submit</netui:button>
54 <netui:button action="exit">Exit</netui:button>
55 </netui:form>
56
57 <netui:errors/>
58
59 </blockquote>
60
61 </body>
62 </html>
|