1 / 25

An Environment for Java Servlet & JSP Development ~ Apache Tomcat ~

An Environment for Java Servlet & JSP Development ~ Apache Tomcat ~. Basic Setup Steps. Download & Install Java S/W Development Kit Download a server (Apache Tomcat) Configure the server Set up development environment Test your setup Establish a deployment method

rupali
Télécharger la présentation

An Environment for Java Servlet & JSP Development ~ Apache Tomcat ~

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. An Environment for Java Servlet & JSP Development~ Apache Tomcat ~

  2. Basic Setup Steps • Download & Install Java S/W Development Kit • Download a server (Apache Tomcat) • Configure the server • Set up development environment • Test your setup • Establish a deployment method • Create custom Web applications

  3. http://tomcat.apache.org

  4. Install Instructions • Get & install 5.5.15 Core Windows Executable (apache-tomcat-5.5.15.exe) • Configuration • Port? (8080 or 80) • User: admin • Password: webtech

  5. Installation Configuration(pswd: webtech)

  6. Set Path to the Installed JVM(Tomcat 5.5 is designed to run on J2SE 5.0 and later.)

  7. What’s Running on Port 80? • IIS • Apache HTTP Server • Tomcat • May need to shut-down other servers or services prior to starting Tomcat. • Start/Control/Administrative Tools/Services • Select the service, properties, set to Manual

  8. http://localhost(index.jsp) or http://localhost:8080

  9. index.jsp$CATALINA_HOME/webapps/ROOT/index.jsp

  10. $CATALINA_HOME(root of Tomcat Install)

  11. Observe Directory Structure

  12. Test Install - HTML, JSP, Servlets • Need to test • Static HTML • JSP • Servlets • Test files provided • Testing.html, Testing.jsp, TestingServlet.java • Use default setting (webapps/ROOT)

  13. Static HTML - Testing.html

  14. JSPs - Testing.jsp

  15. Servlets – TestingServlet.java • Must be compiled, put in appropriate directories, and referenced correctly.

  16. Check Java 2 Installation & Path(will compile from command line) >java –version >javac –help

  17. If NOT? • Need to install SDK (http://java.sun.com) • Later versions use JRE only (+ Eclipse’s compiler included) • Path env var may be needed c:\Program Files\Java\jdk1.5.0_04;c:\Program Files\Java\jdk1.5.0_04\bin;

  18. Need servlet Packages

  19. CLASSPATH Environment Variable .;C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar; C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar

  20. Clean Compile

  21. Additional Server Configuration • Enable invoker servlet • Eliminates need for deployment descriptors • Handy during development • Turn on servlet reloading • Checks if servlet has been modified and will be reloaded • Handy during development

  22. Enable Invoker Servlet • Can run servlets without modifying deployment descriptor • Allows you to just drop compiled servlets into WEB-INF/classes directory • Modify $CATALINA_HOME\conf\web.xml • Uncomment 2 elements (servlet & servlet-mapping) • Use URL http://localhost/servlet/ServletName

  23. Servlet Reloading • Turn on servlet reloading • Ck if has been modified since last load • Off by default for production • Modify $CATALINA_HOME\conf\context.xml <Context reloadable=“true”> • Backup prior to changing

  24. Servlet Execution

  25. JSPs - Testing.jsp

More Related