EJB SolutionIn this section, the EJB and servlet codes have already been created using a third-party tool. You will learn how to use NAB 4.0 to import the EJBs and build the iCash application. The credit card validation is implemented using a stateless session bean. The following EJB and servlet files are created using a third-party tool:
|
To compile the EJB files, select Build Project from the Build menu.
NAB creates all the executable objects of the EJB, including stub and skeleton. The Project Window displays the compiled EJB files as shown in the following illustration:
![]() |
To import and compile the servlet, perform the following steps:
1. Copy the servlet file - iCashServlet.java into the directory <NAS root>\creditcard
2. Using NAB, select Import Servlet(s) from the Project menu.
3. Select the servlet file, either by navigating or by entering the file name, and click Add.
The Project Window displays the imported servlet file as shown in the following illustration:
4. Select Compile File from the Build menu to compile this servlet.
Finally, create a HTML page as shown in the following illustration:
and set the form's action as /NASApp/creditcard/iCashServlet.