getValue();
String publisher = (String)inputText3.getValue();
String edition = (String)inputText4.getValue();
String title = (String)inputText5.getValue();
String author = (String)inputText6.getValue();
154 7 Ajax with JSF-Ajax4jsf
Statement stmt = conn.createStatement();
String sql =
???INSERT INTO Catalog VALUES(??? + ???\??™??? + catalogId +
???\??™??? + ???,??? +
???\??™??? + journal + ???\??™??? + ???,??? + ???\??™???
+ publisher + ???\??™??? + ???,??? +
???\??™??? + edition + ???\??™??? + ???,??? + ???\??™???
+ title + ???\??™??? + ???,??? +
???\??™??? + author + ???\??™??? + ???)???;
stmt.execute(sql);
stmt.close();
conn.close();
} catch (javax.naming.NamingException e) {
return ???error???;
} catch (SQLException e) {
return ???error???;
}
return ???catalog???;
}
}
7.7 Processing the Ajax Response
In this section we shall validate the Catalog ID value specified in the input
form with Oracle database table Catalog. If the Catalog ID is not valid, a
message shall be displayed to indicate that the Catalog ID is not valid, the
form field values shall get filled, and the Submit button shall get disabled.
If the Catalog ID is valid, a validation message shall indicate the same, the
form fields shall be set to empty String values and the Submit button shall
be enabled. For a valid Catalog ID, we shall create a catalog entry with the
Submit button. The JSF components set in the reRender attribute of the
a4j:support tag specify the components to be updated with the Ajax
response.
Pages:
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145