Java Reference
In-Depth Information
L ISTING 12.9
Continued
try {
ctx.close();
}
catch (NamingException ex) {
}
}
}
To see this servlet in action, compile and copy the EJBTestServlet to the
<SERVER_ROOT>/servers/default/default-app/WEB-INF/classes directory and open your
browser to the following URL:
http://localhost/servlet/EJBTestServlet?months=360&
principle=250000&name=Bob&phone=(303)555-1212
Summary
Enterprise JavaBeans are a very robust and scalable option for building the business logic and
persistence layers for your Web application. They provide the ability to easily distribute the
application without making any code changes. If it is architected correctly, the application's
infrastructure is easily changed with a simple redeployment.
This chapter is a beginning look at Enterprise JavaBeans. EJBs are quite powerful and hope-
fully you now have enough knowledge to further your understanding and develop enterprise
level applications using Enterprise JavaBeans.
In the next chapter you will create a Controller servlet that will be at the core of our case
studies.
 
Search WWH ::




Custom Search