Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tomcat, JSP, Servlet Tutorial. Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application.

Similar presentations


Presentation on theme: "Tomcat, JSP, Servlet Tutorial. Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application."— Presentation transcript:

1 Tomcat, JSP, Servlet Tutorial

2 Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application

3 Installing the Java Software Development Kit JDK 5.0 Update 4 (SDK/JDK) Choose SDK not JRE JSP requires a compiler in SDK d.jsp d.jsp

4 Set JAVA_HOME environment variable Set JAVA_HOME to the location of Java SDK (C:\Program Files\Java\jdk1.5.0_04)

5 Install Tomcat Binary exe s/downloads_tomcat-5.cgi s/downloads_tomcat-5.cgi

6 Set CATALINA_HOME environment variable Set CATALINA_HOME to the location of Tomcat (C:\Program Files\Apache Software Foundation\Tomcat 5.5)

7 Example Web Application Overview Start Tomcat by bin/tomcat5w

8 Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application

9 Download the source code of servlet HelloWorldExample.java e.java

10

11 Deploy a servlet – Step 1 Write the servlet Java code Copy Tomcat 5.5\common\lib\servlet- api.jar to jre1.5.0_04\lib\ext Compile javac HelloWorldExample.java Copy HelloWorldExample.class to Tomcat 5.5\webapps\ROOT\WEB- INF\classes

12 Deploy a servlet – Step 2 Add servlet mapping to Tomcat 5.5\webapps\ROOT\WEB-INF\web.xml

13 HelloWorldExample servlet HelloWorldExample HelloWorldExample

14 Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application

15 Write JSP code Write JSP pages then deploy them as html files contains Java code Copy JSP code from

16

17 Deploy JSP Save JSP as HelloWorld.jsp to Tomcat 5.5\webapps\ROOT See the result at

18 Result of a JSP page The same result as the servlet replies Much easier

19 Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application

20 Install MySQL 4.1 Windows (x86) a /4.1.html /4.1.html

21 Configure root password \bin\mysql – u root USE mysql UPDATE user SET password=password('root3394') where user='root'; FLUSH PRIVILEGES; quit

22 Install EMS MySQL Manager 3

23 Create a database table

24 Handset table Create a handset table with fields manufacturer model_name price

25 Data in the handset table EMS lets you to input data easily

26 Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application

27 Use MySQL on Tomcat by MySQL JDBC Driver Source and Binaries (zip) ctor/j/3.1.html ctor/j/3.1.html Input mysql-connector-java bin.jar to ROOT\WEB-INF\lib

28

29

30 Result of HandsetList.jsp

31 Reference JavaServer Pages By Hans Bergsten


Download ppt "Tomcat, JSP, Servlet Tutorial. Outline Setting Up the JSP Environment Servlet JSP Setting Up the MySQL Environment e-commerce web application."

Similar presentations


Ads by Google