|
| | Free Ebook Computer Programming : WebObjects J2EE Programming Guide.pdf
Java Server Pages (JSP) and servlets are important parts of Sun’s J2EE (Java 2 Platform, Enterprise Edition) architecture. JSP is a specification that defines interfaces that servlet-container vendors can implement to provide developers the ability to create dynamic Web pages, which are files with the extension .jsp. Servlet containers interpret these files and create servlets (also know as workhorse servlets) to process HTTP requests and produce responses. Servlets are server plug-ins that extend the capabilities of your Web server. They provide a straightforward deployment mechanism for your applications. Servlets are deployed inside servlet containers, which are plug-ins to your Web server. You should read this document if you want to deploy your WebObjects applications inside a servlet container or want to take advantage of WebObjects components (both standard and custom) in your JSP pages. Deploying WebObjects applications as servlets allows you to take advantage of the features that your servlet container provides. Keep in mind that deployment tools such as Monitor and wotaskd do not work with servlets. WebObjects uses version 2.2 of the Servlet API, and version 1.1 of the JSP specification. Servlets are generic server extensions that expand the functionality of a Web server. By deploying WebObjects applications as servlets running inside servlet containers, you can take advantage of the features that your servlet container offers. Alternatively, you can deploy your applications using an HTTP adaptor that runs as a plug-in in your Web server. The adaptor forwards requests to your servlet container. Download free ebook : Apple--WebObjects_J2EE_Programming_Guide.pdf important parts of Sun’s J2EE (Java 2 Platform, Enterprise Edition) architecture WebObjects applications can be deployed as servlets inside a servlet container such as Tomcat, WebLogic, orWebSphere. When an application runs as a servlet, instead of as a separate Java virtual machine (JVM) process, it runs inside the servlet container’s JVM, along with other applications. Note, however, that you can run only one instance of an application inside a servlet container. To run multiple instances of an application, you have to use multiple servlet containers. In addition, WebObjects deployment tools such as Monitor and wotaskd cannot be used with servlets. To deploy an application as a servlet, you need to add the JavaWOJSPServlet framework to your project. When you build the project, Project Builder generates a WAR (Web application archive) file in addition to the WOA (WebObjects application) bundle. The WAR file has the appropriate classes and the web.xml file in the WEB-INF directory that your servlet container needs to launch the servlet. All you need to do in order to deploy the servlet is copy the WAR file to the application deployment directory of your servlet container. See “Installing Servlets inWebSphere” (page 19) for special steps required to install servlets inWebSphere. You may have to modify web.xml.template, specifically the %WOClassPath% marker, to ensure that the class path to the application’s WOA bundle is correct. For WebLogic, the default Session class must be placed in a package because it conflicts with an internal WebLogic class. In general, all your classes should be inside packages. The WAR file is not a complete application.WebObjects Deployment must be installed on the application host, as well as the application’s WOA bundle. However, using the Servlet Single Directory Deployment feature, you can deploy directories that contain all the necessary WebObjects classes. For more information, see “Servlet Single Directory Deployment” (page 16).
|
|