-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g
Next, we create a servlet client that is invoked from the input form using an Ajax request. The servlet does not differentiate between an Ajax request and a regular HTTP request. It is the Java Script in the browser that implements the Ajax. The servlet is the client to the session bean and invokes session bean methods to validate a catalog id specified in the input form, and persist a Catalog entity instance constructed from the input form field values if a catalog id is valid.
To create a Servlet class, select the ViewController project in the Application navigator and select File|New and Web Tier|Servlets in New Gallery. Select HTTP Servlet in Items and click on OK.

In the Create HTTP Servlet window, click on Next. Select Web Application Version: Java EE 1.5 and click on Next.

Specify Servlet Class as EJB3ClientServlet, Package as model, and Content Type as HTML. Click on Next.

Specify the servlet mapping URL Pattern and click on Next.

In the Servlet Parameters window...
Change the font size
Change margin width
Change background colour