In this section, we will run the Ajax application. Run ajaxBoss.jsp
using the URL http://localhost:8080/jboss-ajax/ajaxJBoss.jsp
. The input form for a catalog entry gets displayed, as shown in the following screenshot:
Start to specify a Catalog Id value. As an Ajax request is sent to the server, with each modification to the Catalog Id value, a response is returned from the server and a message gets displayed about the validity of Catalog Id, which is shown in the following screenshot:
The business logic used for Catalog Id to be valid is that the value should be unique, but another logic can be used instead. Catalog Id (catalog) is still valid, as shown in the following screenshot:
Specify a Catalog Id value that is already in the MySQL database, catalog1
for example. A message Catalog Id is not Valid gets displayed, and the input fields get filled with the catalog entry's field values, as follows:
Specify catalog2
as Catalog Id, which is also not valid, as shown in the following screenshot:
Specify catalog3
as Catalog Id. As the catalog3
value is not already in the database, Catalog Id is valid, as shown in the following screenshot:
Add field values for a new catalog entry and click on Submit, as shown in the following screenshot:
A new catalog entry gets created as indicated by the message shown in the following screenshot:
If the catalog3
value is re-added to the Catalog Id field, the Catalog Id is not Valid message gets displayed, as shown in the following screenshot: