10 tips for building Java servlet applications with IBM tools

IBM's VisualAge tool helps you build Java servlets on high-traffic servers that execute faster than CGI applications.

Many dynamic web applications, especially those that access databases based on user input, need to be on the server.

Typically, these have been implemented using a Common Gateway Interface (CGI) application. Using, for example, Sun's JavaServer, such programs can instead be implemented with the Java programming language.

The advantage of a Java servlet on servers with lots of traffic is that they can execute more quickly than CGI applications. Rather than causing a separate program process to be created, each user request is invoked as a thread in a single daemon process, meaning that the amount of system overhead for each request is slight.

The following tips are a quick guide for developers starting out building servlet applications. They are based on the use of the popular IBM VisualAge tool.

1. Pick the latest version of VisualAge for Java possible when developing servlets, and always apply the latest fix packs.

2. Use the Enterprise version of VisualAge for Java if you are planning on delivering Java applications for you company. The Professional edition is a good choice if you are just beginning to learn Java.

3. Export your servlet application packages to an external directory for testing.

4. Remember to specify URLs correctly qualifying packages names in web apps. Use a period, not a forward slash.

5. Use the best web server engine test environment possible. The latest version of IBM WebSphere matches the support in VisualAge for Java and your other development tools.

6. Build your application as Java beans. A "beans" approach brings several advantages to your applications: separation of the business logic from the interfaces, easy access for reuse to all your business logic and the thousands of classes in Java and the ability to build "smart" components that reduce development by an order of magnitude.

7. Build the interface to your applications using servlets. Servlets provide a simple "message based, client-server" common interface to your applications.

8. Leverage the power of DB2. It has very robust support for integrating applications and transactions using stored procedures, reliable application messaging, distributed data access and object store.

9. Build the web interface to your servlets using Java Server Pages. JSP is a scripting language for incorporating Java beans into web pages.

10. Expect more from your tools and yourself. With Java, there are many facets of development that are under your control.

About the Author

From "Servlets Part 2: Understanding Java servlets and putting them to work" by Jim Mason, AS/400 Experts Journal, Vol. 3, No. 2, March/April 2000. Provided courtesy of The 400 Group.

For More Information


This was first published in November 2000

Dig deeper on Oracle Java and J2EE

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close