SlideShare a Scribd company logo
Java Web Applications   and Deployment Svetlin Nakov Borislava Spasova
Contents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using Tomcat Web Application Server
What is a Web Container? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What Is Tomcat? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web Container and Web Server Integration ,[object Object]
Installing Tomcat ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Running Tomcat ,[object Object],[object Object],[object Object],bin/startup.bat set JAVA_HOME= C:rogra~1avadk1. 6 .0_ 23 rem This space in the path will cause problems! set JAVA_HOME="C:rogram Filesavadk1. 6 .0_ 23"
Tomcat Directory Structure  (as in Tomcat 7.0.11) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Java Web Applications Structure and Deployment
Java Web Applications ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web Applications Structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example – Login / Logout Web Application Structure The root directory of the Web application Classes of the application (including servlets) Libraries of the application (e.g. JDBC drivers) Deployment descriptor (configuration file) Public accessible files (HTML, JSP, CSS, ...) Special directory
WAR Files ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
WAR Files – Example ,[object Object],[object Object]
The Deployment Descriptor ( web.xml ) ,[object Object],[object Object],[object Object],[object Object],[object Object],<web-app version=&quot;2.4&quot;   xmlns=&quot;http://java.sun.com/xml/ns/j2ee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;> ... </web-app>
What is Defined in The Deployment Descriptor? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mapping a Servlet to URL ,[object Object],[object Object],[object Object],<servlet> <servlet-name> LoginServlet </servlet-name> <servlet-class> com.mycompany.myproduct. web. LoginServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name> LoginServlet </servlet-name> <url-pattern>/login</url-pattern> </servlet-mapping>
[object Object],[object Object],Configuring The Servlet Initialization Parameters <servlet> <servlet-name>InitTest</servlet-name> <servlet-class>myservlets.InitServlet</servlet-class> <init-param> <param-name> username </param-name> <param-value>admin</param-value> </init-param> <init-param> <param-name>emailAddress</param-name> <param-value>admin@localhost</param-value> </init-param> </servlet> getServletConfig().getInitParameter(&quot; username &quot;);
Sample  web.xml  File <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <web-app version=&quot;2.4&quot; xmlns=&quot;http://java.sun.com/xml/ns/j2ee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;> <servlet> <servlet-name>TimeServlet</servlet-name> <servlet-class>TimeServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>TimeServlet</servlet-name> <url-pattern>/TimeServlet</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
Creating Web Application and Deploying on Tomcat ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating Web Application and Deploying on Tomcat (2) <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <web-app version=&quot;2.4&quot; xmlns=   &quot;http://java.sun.com/xml/ns/j2ee&quot; xmlns:xsi=   &quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;> <servlet> <servlet-name> Hello Servlet</servlet-name> <servlet-class> Hello Servlet</servlet-class> </servlet> <servlet-mapping> <servlet-name> Hello Servlet</servlet-name> <url-pattern>/ Hello Servlet</url-pattern> </servlet-mapping> </web-app> web.xml
Creating Web Application and Deploying on Tomcat (3) ,[object Object],[object Object],[object Object],[object Object],http://localhost:8080/myapp/HelloForm.html
Problems ,[object Object],[object Object],[object Object]
Homework ,[object Object],[object Object],[object Object]

More Related Content

What's hot

Servlets
ServletsServlets
Servlets
ZainabNoorGul
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
 
Node.js Express Framework
Node.js Express FrameworkNode.js Express Framework
Node.js Express Framework
TheCreativedev Blog
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
BG Java EE Course
 
Web api
Web apiWeb api
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
Madishetty Prathibha
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
Prem Sanil
 
Express js
Express jsExpress js
Express js
Manav Prasad
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
Er. Kamal Bhusal
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
ejlp12
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
SAMIR BHOGAYTA
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
Patrick Savalle
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
Tricode (part of Dept)
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Emprovise
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
NexThoughts Technologies
 
Java API
Java APIJava API

What's hot (20)

Servlets
ServletsServlets
Servlets
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
Node.js Express Framework
Node.js Express FrameworkNode.js Express Framework
Node.js Express Framework
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Web api
Web apiWeb api
Web api
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
 
Servlets
ServletsServlets
Servlets
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
Express js
Express jsExpress js
Express js
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
RESTful API - Best Practices
RESTful API - Best PracticesRESTful API - Best Practices
RESTful API - Best Practices
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Java API
Java APIJava API
Java API
 

Viewers also liked

WebLogic Deployment Plan Example
WebLogic Deployment Plan ExampleWebLogic Deployment Plan Example
WebLogic Deployment Plan Example
James Bayer
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121WANGCHOU LU
 
3) web development
3) web development3) web development
3) web developmenttechbed
 
Introduction to jsf 2
Introduction to jsf 2Introduction to jsf 2
Introduction to jsf 2
yousry ibrahim
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deploymenttechbed
 
JSF 2.2
JSF 2.2JSF 2.2
JSF 2.2
Edward Burns
 
Rich faces
Rich facesRich faces
Rich faces
BG Java EE Course
 
Lecture 11 bitwise_operator
Lecture 11 bitwise_operatorLecture 11 bitwise_operator
Lecture 11 bitwise_operatoreShikshak
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cpp
gourav kottawar
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedBG Java EE Course
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technologyvikram singh
 
Screenshot of Desktop System Application Complete
Screenshot of Desktop System Application CompleteScreenshot of Desktop System Application Complete
Screenshot of Desktop System Application CompleteHendrawan Hendrawan
 
12 installing eclipse
12   installing eclipse12   installing eclipse
12 installing eclipse
Zeeshan-Shaikh
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistry
JITU MISTRY
 
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow
 
WebService-Java
WebService-JavaWebService-Java
WebService-Java
halwal
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
Kevin OBrien
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
BG Java EE Course
 
3 java - variable type
3  java - variable type3  java - variable type
3 java - variable type
vinay arora
 

Viewers also liked (20)

WebLogic Deployment Plan Example
WebLogic Deployment Plan ExampleWebLogic Deployment Plan Example
WebLogic Deployment Plan Example
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121
 
3) web development
3) web development3) web development
3) web development
 
Introduction to jsf 2
Introduction to jsf 2Introduction to jsf 2
Introduction to jsf 2
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deployment
 
JSF 2.2
JSF 2.2JSF 2.2
JSF 2.2
 
Rich faces
Rich facesRich faces
Rich faces
 
Lecture 11 bitwise_operator
Lecture 11 bitwise_operatorLecture 11 bitwise_operator
Lecture 11 bitwise_operator
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cpp
 
Inheritance C#
Inheritance C#Inheritance C#
Inheritance C#
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advanced
 
An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
 
Screenshot of Desktop System Application Complete
Screenshot of Desktop System Application CompleteScreenshot of Desktop System Application Complete
Screenshot of Desktop System Application Complete
 
12 installing eclipse
12   installing eclipse12   installing eclipse
12 installing eclipse
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistry
 
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
 
WebService-Java
WebService-JavaWebService-Java
WebService-Java
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
3 java - variable type
3  java - variable type3  java - variable type
3 java - variable type
 

Similar to Web Applications and Deployment

Tomcat server
 Tomcat server Tomcat server
Tomcat server
Utkarsh Agarwal
 
Tomcat Configuration (1)
Tomcat Configuration (1)Tomcat Configuration (1)
Tomcat Configuration (1)
nazeer pasha
 
Java Servlets
Java ServletsJava Servlets
Java ServletsNitin Pai
 
Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache Tomcat
Auwal Amshi
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran TochAdil Jafri
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configuration
Dima Gomaa
 
Tomcat tutorail
Tomcat tutorailTomcat tutorail
Tomcat tutorail
Supratim Ray
 
Apache Tomcat 8 Application Server
Apache Tomcat 8 Application ServerApache Tomcat 8 Application Server
Apache Tomcat 8 Application Servermohamedmoharam
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
Ankit Minocha
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
Ben Abdallah Helmi
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
vishal choudhary
 
Web Application Deployment
Web Application DeploymentWeb Application Deployment
Web Application Deploymentelliando dias
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3
Ben Abdallah Helmi
 
Tumbleweed intro
Tumbleweed introTumbleweed intro
Tumbleweed intro
Rich Helton
 

Similar to Web Applications and Deployment (20)

Lect06 tomcat1
Lect06 tomcat1Lect06 tomcat1
Lect06 tomcat1
 
Tomcat server
 Tomcat server Tomcat server
Tomcat server
 
bjhbj
bjhbjbjhbj
bjhbj
 
Tomcat Configuration (1)
Tomcat Configuration (1)Tomcat Configuration (1)
Tomcat Configuration (1)
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache Tomcat
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
Auxiliary : Tomcat
Auxiliary : TomcatAuxiliary : Tomcat
Auxiliary : Tomcat
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configuration
 
Unit5 servlets
Unit5 servletsUnit5 servlets
Unit5 servlets
 
Tomcat tutorail
Tomcat tutorailTomcat tutorail
Tomcat tutorail
 
Apache Tomcat 8 Application Server
Apache Tomcat 8 Application ServerApache Tomcat 8 Application Server
Apache Tomcat 8 Application Server
 
Java Servlets & JSP
Java Servlets & JSPJava Servlets & JSP
Java Servlets & JSP
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
 
Web Application Deployment
Web Application DeploymentWeb Application Deployment
Web Application Deployment
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3
 
Jira Rev002
Jira Rev002Jira Rev002
Jira Rev002
 
Tumbleweed intro
Tumbleweed introTumbleweed intro
Tumbleweed intro
 

More from BG Java EE Course

JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
BG Java EE Course
 
JSTL
JSTLJSTL
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
BG Java EE Course
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
BG Java EE Course
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsBG Java EE Course
 
Creating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSCreating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSBG Java EE Course
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
BG Java EE Course
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
BG Java EE Course
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
BG Java EE Course
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
BG Java EE Course
 
Introduction to-RDBMS-systems
Introduction to-RDBMS-systemsIntroduction to-RDBMS-systems
Introduction to-RDBMS-systems
BG Java EE Course
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
BG Java EE Course
 
Basic input-output-v.1.1
Basic input-output-v.1.1Basic input-output-v.1.1
Basic input-output-v.1.1
BG Java EE Course
 
Strings v.1.1
Strings v.1.1Strings v.1.1
Strings v.1.1
BG Java EE Course
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
BG Java EE Course
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
BG Java EE Course
 

More from BG Java EE Course (20)

JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
 
JSTL
JSTLJSTL
JSTL
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
CSS
CSSCSS
CSS
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
WWW and HTTP
WWW and HTTPWWW and HTTP
WWW and HTTP
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
 
Creating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSCreating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSS
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 
Introduction to-RDBMS-systems
Introduction to-RDBMS-systemsIntroduction to-RDBMS-systems
Introduction to-RDBMS-systems
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
 
Basic input-output-v.1.1
Basic input-output-v.1.1Basic input-output-v.1.1
Basic input-output-v.1.1
 
Strings v.1.1
Strings v.1.1Strings v.1.1
Strings v.1.1
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
 

Web Applications and Deployment

  • 1. Java Web Applications and Deployment Svetlin Nakov Borislava Spasova
  • 2.
  • 3. Using Tomcat Web Application Server
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Java Web Applications Structure and Deployment
  • 11.
  • 12.
  • 13. Example – Login / Logout Web Application Structure The root directory of the Web application Classes of the application (including servlets) Libraries of the application (e.g. JDBC drivers) Deployment descriptor (configuration file) Public accessible files (HTML, JSP, CSS, ...) Special directory
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Sample web.xml File <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <web-app version=&quot;2.4&quot; xmlns=&quot;http://java.sun.com/xml/ns/j2ee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;> <servlet> <servlet-name>TimeServlet</servlet-name> <servlet-class>TimeServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>TimeServlet</servlet-name> <url-pattern>/TimeServlet</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
  • 21.
  • 22. Creating Web Application and Deploying on Tomcat (2) <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <web-app version=&quot;2.4&quot; xmlns= &quot;http://java.sun.com/xml/ns/j2ee&quot; xmlns:xsi= &quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;> <servlet> <servlet-name> Hello Servlet</servlet-name> <servlet-class> Hello Servlet</servlet-class> </servlet> <servlet-mapping> <servlet-name> Hello Servlet</servlet-name> <url-pattern>/ Hello Servlet</url-pattern> </servlet-mapping> </web-app> web.xml
  • 23.
  • 24.
  • 25.

Editor's Notes

  1. webapp directory is considered the Web application root directory. All JSP, HTML, JavaScript files, and other resources are under this directory. The WEB-INF directory contains resources used by the application, WEB-INF is not in the public document root—no files contained in this directory structure are accessible by a client. The classes directory (under WEB-INF) contains servlets, beans, and utility classes needed for webapp&apos;s operation. lib directory (under WEB-INF) contains Java archive files (JARs), such as the JDBC driver or tag library, on which webapp depends. If a class is present in a JAR file and in the classes directory, the class loader loads the one in the classes directory.
  2. Notes Order matters: servlet before servlet-mapping JSP: Use jsp-file instead of servlet-class