Running the Ajax application

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:

Running the Ajax application

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:

Running the Ajax application

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:

Running the Ajax application

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:

Running the Ajax application

Specify catalog2 as Catalog Id, which is also not valid, as shown in the following screenshot:

Running the Ajax application

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:

Running the Ajax application

Add field values for a new catalog entry and click on Submit, as shown in the following screenshot:

Running the Ajax application

A new catalog entry gets created as indicated by the message shown in the following screenshot:

Running the Ajax application

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:

Running the Ajax application
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.210.166