Resin

For details, see Section 2.6.

Downloading the Software

  • http://caucho.com/resin/. Click on the download link at the bottom of the page and follow the instructions.

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
  • Online Documentation: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/servletapi/

  • Download Documentation: http://java.sun.com/products/jsp/download.html

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:

  1. Set the JAVA_HOME variable. Set this variable to list the base Java installation directory, not the bin subdirectory.

  2. 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
  • Code: install_dir /doc/WEB-INF/classes

  • URL: http:// host /servlet/ ServletName

Packaged Servlets
  • Code: install_dir /doc/WEB-INF/classes/ packageName

  • URL: http:// host /servlet/ packageName.ServletName

Packaged Beans and Utility Classes
  • install_dir /doc/WEB-INF/classes/ packageName

JAR Files
  • install_dir /doc/WEB-INF/lib

HTML and JSP Pages (Not In Subdirectories)
  • Code Location: install_dir /doc

  • URL: http:// host/filename

HTML and JSP Pages (In Subdirectories)
  • Code Location: install_dir /doc/ directoryName

  • URL: http:// host/directoryName/filename

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
  • install_dir /webapps/ webappName /WEB-INF/classes/ packageName

JAR Files
  • install_dir /webapps/ webappName /WEB-INF/lib

HTML and JSP Pages (Not In Subdirectories)
  • Code Location: install_dir /webapps/ webappName

  • URL: http:// host/webappName/filename

HTML and JSP Pages (In Subdirectories)
  • Code Location: : install_dir /webapps/ webappName / directoryName

  • URL: http:// host/webappName/directoryName/filename

Viewing Autogenerated Code for JSP Pages

You can view the servlet code that Resin generates from your JSP pages.

  • Default Web Application: install_dir /doc/WEB-INF/work

  • Custom Web Applications: install_dir /webapps/ webappName /WEB-INF/work



Core Servlets and JavaServer Pages (Vol. 1.Core Technologies)
Core Servlets and Javaserver Pages: Core Technologies, Vol. 1 (2nd Edition)
ISBN: 0130092290
EAN: 2147483647
Year: 2002
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net