jsp listing to the input.jsp in AjaxTags application in
JDeveloper. When a new catalog entry is created with a valid user id the
FormServlet servlet redirects the response to catalog.jsp if a catalog
entry gets created without an error and redirects to error.jsp if the catalog
entry does not get created and generates an error. In the catalog.jsp copy
the following scriptlet, which outputs a message to indicate that a catalog
entry has been created.
<%out.println(???Catalog Entry Created???);%>
To the error.jsp copy the following scriptlet, which outputs a message
to indicate that an error was generated in creating the catalog entry.
<%out.println(???Error in creating Catalog Entry???);%>
Next, we shall run the AjaxTags application in OC4J server. Rightclick
on the input.jsp and select Run as shown in Fig. 6.7.
Fig. 6.7 Running AjaxTags Application
Select a Catalog Id value from the selection list as shown in Fig. 6.8.
6.5 Validating a Form with AjaxTags 125
Fig. 6.8 Selecting a Catalog Id Value
An Ajax request gets sent to the server with the ajax:htmlContent
AjaxTags tag. The server returns an HTML response about the validity of
the Catalog Id value. As the catalog1 value is already in the database, a
validation message gets displayed, ???Catalog Id is not Valid??? as shown in
Fig. 6.9.
126 6 Ajax without JavaScript ??“ AjaxTags
Fig. 6.9 Validating Catalog Id
Update the form fields with the Update Fields button.
Pages:
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