2. Using the Tutorial Examples 3. Getting Started with Web Applications Deploying a Packaged Web Module Updating a Packaged Web Module Mapping URLs to Web Components Setting Initialization Parameters Mapping Errors to Error Screens Declaring a Reference to a Resource Declaring a Reference to a Web Service Accessing Databases from Web Applications Populating the Example Database Creating a Data Source in the Application Server Further Information about Web Applications 5. JavaServer Pages Technology 7. JavaServer Pages Standard Tag Library 10. JavaServer Faces Technology 11. Using JavaServer Faces Technology in JSP Pages 12. Developing with JavaServer Faces Technology 13. Creating Custom UI Components 14. Configuring JavaServer Faces Applications 15. Internationalizing and Localizing Web Applications 16. Building Web Services with JAX-WS 17. Binding between XML Schema and Java Classes 19. SOAP with Attachments API for Java 21. Getting Started with Enterprise Beans 23. A Message-Driven Bean Example 24. Introduction to the Java Persistence API 25. Persistence in the Web Tier 26. Persistence in the EJB Tier 27. The Java Persistence Query Language 28. Introduction to Security in the Java EE Platform 29. Securing Java EE Applications 31. The Java Message Service API 32. Java EE Examples Using the JMS API 36. The Coffee Break Application | Web Application Life CycleA web application consists of web components, static resource files such as images,and helper classes and libraries. The web container provides many supporting services thatenhance the capabilities of web components and make them easier to develop. However,because a web application must take these services into account, the process forcreating and running a web application is different from that of traditional stand-aloneJava classes. The process for creating, deploying, and executing a web application can be summarizedas follows:
Developing web component code is covered in the later chapters. Steps 2 through4 are expanded on in the following sections and illustrated with a Hello,World-style presentation-oriented application. This application allows a user to enter a name intoan HTML form (Figure 3-3) and then displays a greeting after the nameis submitted (Figure 3-4). Figure 3-3 Greeting Form ![]() Figure 3-4 Response ![]() The Hello application contains two web components that generate the greeting and theresponse. This chapter discusses two versions of the application: a JSP version calledhello1, in which the components are implemented by two JSP pages (tut-install/javaeetutorial5/examples/web/hello1/web/index.jsp andtut-install/javaeetutorial5/examples/web/hello1/web/response.jsp) and a servlet version calledhello2, in which the components are implementedby two servlet classes (tut-install/javaeetutorial5/examples/web/hello2/src/servlets/GreetingServlet.java andtut-install/javaeetutorial5/examples/web/hello2/src/servlets/ResponseServlet.java). The two versions are usedto illustrate tasks involved in packaging, deploying, configuring, and running an application thatcontains web components. The sectionChapter 2, Using the Tutorial Examples explains how to get the code for theseexamples. After you install the tutorial bundle, the source code for the examples isin the following directories:
Copyright © 2010, Oracle and/or its affiliates. All rights reserved.Legal Notices |