For details, see Section 2.6. Downloading the Software Bookmarking the Servlet and JSP APIs You can access the APIs online; you can also download them to your machine for faster access. Servlets 2.3 and JSP 1.2 Servlets 2.4 and JSP 2.0 -
Servlet 2.4 Documentation (Online): http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/ -
JSP 2.0 Documentation (Online): http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jspapi/ -
Servlet 2.4 and JSP 2.0 Documentation (Download): http://java.sun.com/products/jsp/download.html Configuring the Server Unzip Resin into the directory of your choice (hereafter referred to as install_dir ) and perform the following two steps: -
Set the JAVA_HOME variable. Set this variable to list the base Java installation directory, not the bin subdirectory. -
Specify the port. Edit install_dir /conf/resin.conf and change the value of the port attribute of the http element from 8080 to 80. Setting Up Your Development Environment -
Create a development directory. Develop code there; copy to the server's deployment directory for testing. -
Set your CLASSPATH . Have it include install_dir /lib/jsdk23.jar , your main development directory, and " . " (the current working directory). -
Make shortcuts to start and stop the server. Right-click on install_dir /bin/httpd.exe , and select Copy. Then go to your development directory, right-click in the window, and select Paste Shortcut (not just Paste). There is no separate shutdown icon; invoking httpd.exe results in a popup window with a Quit button that lets you stop the server. Using the Default Web Application The main location is install_dir /doc . Packageless Servlets Packaged Servlets Packaged Beans and Utility Classes JAR Files HTML and JSP Pages (Not In Subdirectories) HTML and JSP Pages (In Subdirectories) Using Custom Web Applications Create a Web application directory in install_dir /webapps . The directory should have a WEB-INF subdirectory, a web.xml file in WEB-INF (copy the one from the default Web application), and a WEB-INF/classes subdirectory. Instead of a regular directory, you can also use a WAR file (JAR file with file extension renamed from .jar to .war ) with this structure. In the following, we use webappName to refer to the name of the directory (or the base name of the WAR file, minus . war ). See Section 2.11 for details. Packageless Servlets -
Code Location: install_dir /webapps/ webappName /WEB-INF/classes -
Default URL: http:// host/webappName /servlet/ ServletName -
Custom URL: http:// host/webappName/AnyName ( designate / AnyName with servlet and servlet-mapping elements in web.xml ) Packaged Servlets -
Code Location: install_dir /webapps/ webappName /WEB-INF/classes/ packageName -
Default URL: http:// host/webappName /servlet/ packageName.ServletName -
Custom URL: http:// host/webappName/AnyName (designate / AnyName with servlet and servlet-mapping elements in web.xml ) Packaged Beans and Utility Classes JAR Files HTML and JSP Pages (Not In Subdirectories) HTML and JSP Pages (In Subdirectories) Viewing Autogenerated Code for JSP Pages You can view the servlet code that Resin generates from your JSP pages. |