1 / 16

Web Archive Deployment Descriptor

Web Archive Deployment Descriptor. 4.1.0.3. Unit objectives. After completing this unit, you should be able to: Use the Application Developer deployment descriptor editor to configure Web components within a Web module Define welcome and error pages for your Web module

Download Presentation

Web Archive Deployment Descriptor

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Archive Deployment Descriptor 4.1.0.3

  2. Unit objectives After completing this unit, you should be able to: • Use the Application Developer deployment descriptor editor to configure Web components within a Web module • Define welcome and error pages for your Web module • Have a better idea about the various elements of the Web deployment descriptor (web.xml)

  3. WAR File • The Java Servlet 2.2 specification introduced the Web application archive • A Web archive (WAR) file is a packaged Web application • A Web application is a group of HTML pages, JSP pages, servlets, and other resources • WAR files also include a Web deployment descriptor file, web.xml, which describes the Web module

  4. Web Deployment Descriptor Editor (General)

  5. Web Deployment Descriptor Editor (Pages) • Welcome Pages • Login • Error Pages and Java Exception Types

  6. Web Deployment Descriptor Editor (Servlets) • Details • URL Mapping • Initialization • Load on Startup • Security Role Refs • Run As • Icons • WebSphere Extensions • Markup Language • Global Transaction • Local Transaction

  7. Web Deployment Descriptor Editor (Security) • Security Roles • Security Constraints

  8. Web Deployment Descriptor Editor (Filters) • Details • Mappings • URL • Servlet • Initialization • Icons

  9. Web Deployment Descriptor (References) • Define references to: • EJBs and Web services • External resources • Message destinations • Administered objects • DistributedMap • Queue • Topic • DataSource

  10. Web Deployment Descriptor Editor (Extensions) • WebSphere only extensions

  11. Web Deployment Descriptor Editor (Source) <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4"…> <display-name>CS01 Web Module</display-name> <servlet> <display-name>Command Servlet</display-name> <servlet-name>CommandServlet</servlet-name> <servlet-class> com.ibm.servlet.CommandProcessingServlet </servlet-class> <init-param> <param-name>controller</param-name> <param-value> com.ibm.exam.controller.ExamHttpController </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>CommandServlet</servlet-name> <url-pattern>ExamCommand</url-pattern> </servlet-mapping> … </web-app>

  12. Variables Add or remove: Environment variables Tag lib references Message destinations Context parameters MIME Mappings Local encoding mappings JSP property groups Web Services pages WS Handler WS Extensions Web service client security extensions WS Bindings Web service client bindings Other Web Deployment Descriptor Editor Pages

  13. Unit Summary • This unit looked at configuring the Web archive deployment descriptor (web.xml) using the specialized editor supplied with Application Developer.

  14. Checkpoint • How do you register a servlet in a J2EE Web application? • What does load on startup mean? • What triggers can you configure to invoke an error page?

  15. Checkpoint solutions • Servlets are declared as Web components in the web.xml deployment descriptor. • To load a servlet at start-up accomplishes two things. First, servlets that have an involved initialization can be ready to go when the first request for them is made. Second, by permitting the specification of load order, it is possible to configure a servlet whose principal task is to initialize the JVM, for example, by loading JDBC drivers. • Error pages can be triggered on a particular status code or Exception.

  16. Unit summary Having completed this unit, you should be able to: • Use the Application Developer deployment descriptor editor to configure Web components within a Web module • Define welcome and error pages for your Web module • Have a better idea about the various elements of the Web deployment descriptor (web.xml)

More Related