Chapter 3 - Quick Tour
A journey of a thousand miles begins with a single step.
Following the long-standing tradition used in programming books, our first Web application will be "Hello, world." The purpose of "Hello, world" is to get your development environment set up and to go through one complete edit-compile-debug iteration that results in running code. Accomplishing this means that you have solved most of the problems that are unique to a new development environment or programming language. You can then focus on your programming tasks and incrementally learn new features of the tools as you need them. However, Java Web application development has many facets, so we'll develop "Hello, world" in four iterations, each of which focuses on one group of tools in WTP. This will give you a good cross section of the capabilities of WTP. The four iterations are as follows:
- In Iteration 1 you configure an application server, create a Web application, develop a simple JavaServer Pages (JSP) document that prints a greeting, and run it on the server.
- In Iteration 2 you add a login JSP, write Java scriptlets to display the user name, create a Java servlet that controls the application page flow, and debug the servlet and JSPs.
- In Iteration 3 you create a database to store user information, develop an SQL query to access it, and add Java Database Connectivity (JDBC) calls to your servlet to invoke the query and retrieve the user information.
- In Iteration 4 you deploy the database query as a Web service, generate a JSP test client that invokes the Web service, and monitor the Simple Object Access Protocol (SOAP) message traffic.
After completing the Quick Tour, you'll have a fair understanding of the fundamentals of Java Web application development with WTP. You should then be comfortable enough with WTP to begin developing simple Web applications and to explore the other features of the environment. So power up your computer and get ready to code. The tour is about to begin!
Other Sections in This Chapter
- Iteration 1: J2EE Web Applications
- Add a Server Runtime Environment
- Create a Dynamic Web Project
- Create and Edit a JSP
- Run the JSP on the Server
- Summary of Iteration 1
- Iteration 2: Servlets and Scriptlets
- Add a Java Scriptlet to a JSP
- Debug a JSP
- Create a Servlet
- Debug a Servlet
- Summary of Iteration 2
- Iteration 3: Database Access
- Connect to a Database
- Execute SQL Statements
- Add Database Access to a Web Application
- Summary of Iteration 3
- Iteration 4: Web Services
- Deploy a Web service
- Use a Test Client
- Monitor SOAP Messages
- Summary of Iteration 4