SlideShare a Scribd company logo
1 of 28
Download to read offline
Introduction to Apache Tomcat 7.0
Mark Thomas, Sr. Software Engineer, SpringSource
August 2010




                                                   © 2009 VMware Inc. All rights reserved
Agenda
   Introduction
   Overview
   Servlet 3.0
   JSP 2.2
   EL 2.2
   Other (non-specification) features
   Current status
   Useful resources
   Questions

                                         2
Introduction

   Mark Thomas
   Tomcat committer (6+ years) and PMC member
   Commons committer (DBCP & Pool)
   Apache Software Foundation Member
   Apache Security Team member
   Tomcat 4 release manager
   Tomcat 7 release manager
   Wrote a large proportion of the updates for Tomcat 7
   Lead SpringSource Security Team
   tc Server developer




                                                           3
Overview




                Tomcat 4   Tomcat 5   Tomcat 6   Tomcat 7

      Servlet     2.3        2.4        2.5        3.0

       JSP        1.2        2.0        2.1        2.2

        EL                   (2.0)      2.1        2.2

       Java       1.2?       1.4        1.5        1.6




                                                            4
Servlet 3.0




              5
Servlet 3.0 – Asynchronous processing

 Prior to Servlet 3.0 request/response processing was synchronous
 Response processing can now be asynchronous
 • Requests are still synchronous
 More efficient use of Threads
 All Filters and Servlets in the processing chain must support Async
 Typical uses
 • Accessing external resources
   • Web services
   • Databases
 • Regular updates to users
   • Stock ticker
   • Progress indicator




                                                                        6
Servlet 3.0 – web-fragment.xml & annotations

 META-INF/web-fragment.xml
 • Packaged with any JAR file
 • Broadly same content allowed as web.xml
 • Rules on ordering
 Annotations – Servlets, Filters & Listeners
 • Can be placed on any class in any JAR
 • Scanned on start-up
 • Only scanned if JAR is included in fragment ordering
 Annotations – Security, File Upload
 • Place on Servlets
 • Scanned when Servlet is loaded
 Both fragments and annotations give rise to security concerns
 • Effective web,xml can be logged


                                                                  7
Servlet 3.0 – Dynamic configuration

 Alternative to web-fragment.xml
 Programmatic
    • More control
 Used by ServletContextListeners
 Addition of:
    • Servlets
    • Filters
    • Listeners
   Change session tracking modes
   Change session cookie configuration
   Set initialisation parameters
   Declare security roles


                                          8
Servlet 3.0 – Sessions

 Adds session tracking based on SSL Session ID
 • To URL and cookie based tracking
 Session tracking methods application selectable
 • Configure in ServletContextListener
 • SSL based tracking has to be used on its own
 • Now possible to disable URL based tracking (used to be mandatory)
 Can control default parameters for session cookies
 • Name – may be overridden by Tomcat
 • Domain – may be overridden by Tomcat
 • Path – may be overridden by Tomcat
 • MaxAge
 • Comment
 • Secure – may be overridden by Tomcat
 • HttpOnly – may be overridden by Tomcat
                                                                       9
Servlet 3.0 – Miscellaneous

 httpOnly
 • Not in any of the specifications
 • However, widely supported
 • Prevents scripts accessing the cookie content
 • Provide a degree of XSS protection
 File upload
 • Very similar to commons file upload
 • Used by the Manager application
 Programmatic login
 • Useful when creating a new user account
 • Can log the user in without redirecting them to the login page




                                                                    10
JSP 2.2




          11
JSP 2.2 – JSP Property Group changes

 Three new configuration settings

 <jsp-config>
    <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <default-content-type>text/html</default-content-type>
    </jsp-property-group>
    <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <buffer>4096</buffer>
    </jsp-property-group>
    <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <error-on-undeclared-namespace>
        true
      </error-on-undeclared-namespace>
    </jsp-property-group>
  </jsp-config>




                                                               12
Expression Language 2.2




                          13
EL 2.2 – Method invocations

 EL 2.2 adds support for method invocations

<html>
  <head><title>EL method test cases</title></head>
  <body>
    <%
    TesterBeanA beanA = new TesterBeanA();
    TesterBeanB beanB = new TesterBeanB();
    beanB.setName("Tomcat");
    beanA.setBean(beanB);
    pageContext.setAttribute("testBeanA", beanA);
    pageContext.setAttribute("testBeanB", beanB);
    %>
    <tags:echo echo="00-${testBeanA["bean"].sayHello('JUnit')}" />
    <tags:echo echo="01-${testBeanA.bean.sayHello('JUnit')}" />
    <tags:echo echo="02-${testBeanB.sayHello('JUnit')}" />
  </body>
</html>




                                                                       14
Other Tomcat 7 changes




                         15
Tomcat 7 – Memory leak protection

 It has been back-ported to Tomcat 6
 Two aspects
 • Prevention for JVM context class loader based leaks
 • Detection (and fixing where possible) of application leaks
 Application leaks includes leaks in 3rd party libraries
 JDBC drivers
 • Should be de-registered
 ThreadLocals
 • Should be set to null
 Threads
 • Should be stopped
 Also fixes issues with ResourceBundle, RMI & Security Policies


                                                                   16
Tomcat 7 – Alias support

 New <Context .../> attribute
 aliases
 • “/aliasPath1=docBase1,/aliasPath2=docBase2”
 docBaseN can be a WAR or a directory
 • Must be absolute paths
 Contents NOT deleted on undeploy
 Possible uses:
 • Providing common content to multiple web applications from a single location
 • Providing alternative paths to resources when embedding (e.g. WEB-INF/lib)




                                                                                  17
Tomcat 7 – Manager application

 Correct use of GET and POST
 CSRF protection
  • HTML interface only
 Text interface moved
  • /manager to /manager/text
 Split roles
  • manager-gui (HTML GUI)
  • manager-scripts (text interface for Ant, Maven etc)
  • manager-jmx (JMX proxy)
  • manager-status (just the status page)
 Memory leak detection
  • Stopped, reloaded or un-deployed web applications
  • Has to trigger a full GC to detect the leak


                                                          18
Tomcat 7 – Embedded improvements

 Based on work by Costin
 Single class can create a Tomcat instance in a few lines of code
 • org.apache.catalina.startup.Tomcat
 Very easy to embed
 • Tomcat uses it as the basis of most of the Tomcat 7 unit tests
 ‘Bare bones’ and ‘usual defaults’ options
 Full programmatic access to Tomcat internals
 Smaller number of JARs




                                                                     19
Tomcat 7 – Other improvements and changes

 Prevent session fixation attacks
 • Session ID changed on authentication
 Logging improvements
 • OneLineFormatter
 • VerbatimFormatter
 • AsyncFileHandler
 Lots of internal code clean-up
 • Use of generics
 • Removed unused code
 • StringBuffer replaced with StringBuilder
 • Loggers made final and static where possible
 • Reduce code duplication in the connectors
 Start switch from Valves to Filters

                                                  20
Tomcat 7 – Other improvements and changes

   Generic CSRF protection
   Access log enabled by default
   LockOut Realm configured by default
   Align JMX Beans with code
    • GSoC 2010
    • Start with just a <Server .../> element in server.xml
    • Configure everything else via JMX




                                                              21
Tomcat 7 – Plans

 JSP 196 implementation
    • The Java Authentication SPI for Containers (Servlet Container Profile)
   Enhancements to the memory leak protection
   Simpler configuration of JNDI resources
   Integration with Windows Authentication
   Fewer open bugs
   More frequent releases
   Review outstanding enhancement requests




                                                                               22
Tomcat 7 – Plans

 Implementing the Java EE 6 web profile is not on the roadmap
 • No-one is asking for it
 • Geronimo is in a better position to provide it
 • Tomcat team will monitor demand and review this regularly




                                                                 23
Current status




                 24
Current status

 First release on 29 June 2010
 Current release is 7.0.2
 7.0.x still considered to be in beta




                                         25
Useful resources




                   26
Useful resources

 http://tomcat.apache.org
    • http://tomcat.apache.org/download-70.cgi
    • http://tomcat.apache.org/tomcat-7.0-doc/index.html
   http://tomcat.apache.org/migration.html
   https://svn.apache.org/repos/asf/tomcat/trunk
   git://git.apache.org/tomcat70.git
   announce@tomcat.apache.org
    • Very low traffic
 users@tomcat.apache.org
     Usage questions
 dev@tomcat.apache.org
     Code changes only



                                                           27
Questions




            28

More Related Content

What's hot

Tomcat and apache httpd training
Tomcat and apache httpd trainingTomcat and apache httpd training
Tomcat and apache httpd trainingFranck SIMON
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configurationDima Gomaa
 
Introduction of Tomcat
Introduction of TomcatIntroduction of Tomcat
Introduction of TomcatDebashis Nath
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikEdgar Espina
 
How to monitor and manage Apache Tomcat
How to monitor and manage Apache TomcatHow to monitor and manage Apache Tomcat
How to monitor and manage Apache TomcatEgnyte
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEJacek Laskowski
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuninglovingprince58
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New EvolutionAllan Huang
 
Integrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On WindowsIntegrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On WindowsMohanraj Nagasamy
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121WANGCHOU LU
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technologyMinal Maniar
 
Apache Manager Table of Contents
Apache Manager Table of ContentsApache Manager Table of Contents
Apache Manager Table of Contentswebhostingguy
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletFahmi Jafar
 

What's hot (20)

Apache tomcat
Apache tomcatApache tomcat
Apache tomcat
 
Tomcat next
Tomcat nextTomcat next
Tomcat next
 
Auxiliary : Tomcat
Auxiliary : TomcatAuxiliary : Tomcat
Auxiliary : Tomcat
 
Tomcat and apache httpd training
Tomcat and apache httpd trainingTomcat and apache httpd training
Tomcat and apache httpd training
 
Tomcat configuration
Tomcat configurationTomcat configuration
Tomcat configuration
 
Introduction of Tomcat
Introduction of TomcatIntroduction of Tomcat
Introduction of Tomcat
 
Apache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip HanikApache Tomcat 7 by Filip Hanik
Apache Tomcat 7 by Filip Hanik
 
How to monitor and manage Apache Tomcat
How to monitor and manage Apache TomcatHow to monitor and manage Apache Tomcat
How to monitor and manage Apache Tomcat
 
Apache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEEApache Tomcat + Java EE = Apache TomEE
Apache Tomcat + Java EE = Apache TomEE
 
Tomcat Server
Tomcat ServerTomcat Server
Tomcat Server
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuning
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New Evolution
 
Integrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On WindowsIntegrating Tomcat And Apache On Windows
Integrating Tomcat And Apache On Windows
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Tomcat openssl
Tomcat opensslTomcat openssl
Tomcat openssl
 
Tomcat openssl
Tomcat opensslTomcat openssl
Tomcat openssl
 
Apache Manager Table of Contents
Apache Manager Table of ContentsApache Manager Table of Contents
Apache Manager Table of Contents
 
Tomcat 6: Evolving our server
Tomcat 6: Evolving our serverTomcat 6: Evolving our server
Tomcat 6: Evolving our server
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java Servlet
 

Viewers also liked

Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on TomcatApache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on TomcatTomitribe
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)Roman Kharkovski
 
Java ee com apache tom ee e tomee+ tdc - 2014
Java ee com apache tom ee e tomee+   tdc - 2014Java ee com apache tom ee e tomee+   tdc - 2014
Java ee com apache tom ee e tomee+ tdc - 2014Daniel Cunha
 
Description d'un fichier de prélèvements SEPA minimum
Description d'un fichier de prélèvements SEPA minimumDescription d'un fichier de prélèvements SEPA minimum
Description d'un fichier de prélèvements SEPA minimumFranck SIMON
 
SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"
SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"
SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"guest2c6b3
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Alex Soto
 
From Tomcat to Java EE, making the transition with TomEE
From Tomcat to Java EE, making the transition with TomEEFrom Tomcat to Java EE, making the transition with TomEE
From Tomcat to Java EE, making the transition with TomEEjaxconf
 
2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web ProfileDavid Blevins
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutSander Temme
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"Binary Studio
 
Apache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpApache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpSander Temme
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Logico
 
Automated Tomcat Management
Automated Tomcat ManagementAutomated Tomcat Management
Automated Tomcat Managementseges
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with TomcatSudha Ch
 

Viewers also liked (17)

APACHE TOMCAT
APACHE TOMCATAPACHE TOMCAT
APACHE TOMCAT
 
Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on TomcatApache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
 
Java ee com apache tom ee e tomee+ tdc - 2014
Java ee com apache tom ee e tomee+   tdc - 2014Java ee com apache tom ee e tomee+   tdc - 2014
Java ee com apache tom ee e tomee+ tdc - 2014
 
Description d'un fichier de prélèvements SEPA minimum
Description d'un fichier de prélèvements SEPA minimumDescription d'un fichier de prélèvements SEPA minimum
Description d'un fichier de prélèvements SEPA minimum
 
SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"
SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"
SMAU 2008: "Vulnerabilità in Tomcat: l'evoluzione della specie"
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Java EE 7, what's in it for me?
Java EE 7, what's in it for me?
 
From Tomcat to Java EE, making the transition with TomEE
From Tomcat to Java EE, making the transition with TomEEFrom Tomcat to Java EE, making the transition with TomEE
From Tomcat to Java EE, making the transition with TomEE
 
2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile2011 JavaOne Apache TomEE Java EE 6 Web Profile
2011 JavaOne Apache TomEE Java EE 6 Web Profile
 
Java SE 8 & EE 7 Launch
Java SE 8 & EE 7 LaunchJava SE 8 & EE 7 Launch
Java SE 8 & EE 7 Launch
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"
 
Apache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpApache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling Up
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)
 
Automated Tomcat Management
Automated Tomcat ManagementAutomated Tomcat Management
Automated Tomcat Management
 
Mule management console installation with Tomcat
Mule management console installation with TomcatMule management console installation with Tomcat
Mule management console installation with Tomcat
 

Similar to Introduction to Apache Tomcat 7 Presentation

Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Arun Gupta
 
WildFly AppServer - State of the Union
WildFly AppServer - State of the UnionWildFly AppServer - State of the Union
WildFly AppServer - State of the UnionDimitris Andreadis
 
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010Arun Gupta
 
Tomcat, Undertow, Jetty, Nginx Unit: pros and cons
Tomcat, Undertow, Jetty, Nginx Unit: pros and consTomcat, Undertow, Jetty, Nginx Unit: pros and cons
Tomcat, Undertow, Jetty, Nginx Unit: pros and consGeraldo Netto
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionArun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerArun Gupta
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Arun Gupta
 
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.Dimitris Andreadis
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitJukka Zitting
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Skills Matter
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Arun Gupta
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningMichel Schildmeijer
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3JavaEE Trainers
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and DeploymentBG Java EE Course
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cacheMarc Cortinas Val
 
Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009JavaEE Trainers
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEQAware GmbH
 

Similar to Introduction to Apache Tomcat 7 Presentation (20)

Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
 
WildFly AppServer - State of the Union
WildFly AppServer - State of the UnionWildFly AppServer - State of the Union
WildFly AppServer - State of the Union
 
Hackingtomcat
HackingtomcatHackingtomcat
Hackingtomcat
 
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
 
Tomcat, Undertow, Jetty, Nginx Unit: pros and cons
Tomcat, Undertow, Jetty, Nginx Unit: pros and consTomcat, Undertow, Jetty, Nginx Unit: pros and cons
Tomcat, Undertow, Jetty, Nginx Unit: pros and cons
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
 
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache Jackrabbit
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3
 
ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and Deployment
 
cache concepts and varnish-cache
cache concepts and varnish-cachecache concepts and varnish-cache
cache concepts and varnish-cache
 
Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009
 
A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Introduction to Apache Tomcat 7 Presentation

  • 1. Introduction to Apache Tomcat 7.0 Mark Thomas, Sr. Software Engineer, SpringSource August 2010 © 2009 VMware Inc. All rights reserved
  • 2. Agenda  Introduction  Overview  Servlet 3.0  JSP 2.2  EL 2.2  Other (non-specification) features  Current status  Useful resources  Questions 2
  • 3. Introduction  Mark Thomas  Tomcat committer (6+ years) and PMC member  Commons committer (DBCP & Pool)  Apache Software Foundation Member  Apache Security Team member  Tomcat 4 release manager  Tomcat 7 release manager  Wrote a large proportion of the updates for Tomcat 7  Lead SpringSource Security Team  tc Server developer 3
  • 4. Overview Tomcat 4 Tomcat 5 Tomcat 6 Tomcat 7 Servlet 2.3 2.4 2.5 3.0 JSP 1.2 2.0 2.1 2.2 EL (2.0) 2.1 2.2 Java 1.2? 1.4 1.5 1.6 4
  • 6. Servlet 3.0 – Asynchronous processing  Prior to Servlet 3.0 request/response processing was synchronous  Response processing can now be asynchronous • Requests are still synchronous  More efficient use of Threads  All Filters and Servlets in the processing chain must support Async  Typical uses • Accessing external resources • Web services • Databases • Regular updates to users • Stock ticker • Progress indicator 6
  • 7. Servlet 3.0 – web-fragment.xml & annotations  META-INF/web-fragment.xml • Packaged with any JAR file • Broadly same content allowed as web.xml • Rules on ordering  Annotations – Servlets, Filters & Listeners • Can be placed on any class in any JAR • Scanned on start-up • Only scanned if JAR is included in fragment ordering  Annotations – Security, File Upload • Place on Servlets • Scanned when Servlet is loaded  Both fragments and annotations give rise to security concerns • Effective web,xml can be logged 7
  • 8. Servlet 3.0 – Dynamic configuration  Alternative to web-fragment.xml  Programmatic • More control  Used by ServletContextListeners  Addition of: • Servlets • Filters • Listeners  Change session tracking modes  Change session cookie configuration  Set initialisation parameters  Declare security roles 8
  • 9. Servlet 3.0 – Sessions  Adds session tracking based on SSL Session ID • To URL and cookie based tracking  Session tracking methods application selectable • Configure in ServletContextListener • SSL based tracking has to be used on its own • Now possible to disable URL based tracking (used to be mandatory)  Can control default parameters for session cookies • Name – may be overridden by Tomcat • Domain – may be overridden by Tomcat • Path – may be overridden by Tomcat • MaxAge • Comment • Secure – may be overridden by Tomcat • HttpOnly – may be overridden by Tomcat 9
  • 10. Servlet 3.0 – Miscellaneous  httpOnly • Not in any of the specifications • However, widely supported • Prevents scripts accessing the cookie content • Provide a degree of XSS protection  File upload • Very similar to commons file upload • Used by the Manager application  Programmatic login • Useful when creating a new user account • Can log the user in without redirecting them to the login page 10
  • 11. JSP 2.2 11
  • 12. JSP 2.2 – JSP Property Group changes  Three new configuration settings <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <default-content-type>text/html</default-content-type> </jsp-property-group> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <buffer>4096</buffer> </jsp-property-group> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <error-on-undeclared-namespace> true </error-on-undeclared-namespace> </jsp-property-group> </jsp-config> 12
  • 14. EL 2.2 – Method invocations  EL 2.2 adds support for method invocations <html> <head><title>EL method test cases</title></head> <body> <% TesterBeanA beanA = new TesterBeanA(); TesterBeanB beanB = new TesterBeanB(); beanB.setName("Tomcat"); beanA.setBean(beanB); pageContext.setAttribute("testBeanA", beanA); pageContext.setAttribute("testBeanB", beanB); %> <tags:echo echo="00-${testBeanA["bean"].sayHello('JUnit')}" /> <tags:echo echo="01-${testBeanA.bean.sayHello('JUnit')}" /> <tags:echo echo="02-${testBeanB.sayHello('JUnit')}" /> </body> </html> 14
  • 15. Other Tomcat 7 changes 15
  • 16. Tomcat 7 – Memory leak protection  It has been back-ported to Tomcat 6  Two aspects • Prevention for JVM context class loader based leaks • Detection (and fixing where possible) of application leaks  Application leaks includes leaks in 3rd party libraries  JDBC drivers • Should be de-registered  ThreadLocals • Should be set to null  Threads • Should be stopped  Also fixes issues with ResourceBundle, RMI & Security Policies 16
  • 17. Tomcat 7 – Alias support  New <Context .../> attribute  aliases • “/aliasPath1=docBase1,/aliasPath2=docBase2”  docBaseN can be a WAR or a directory • Must be absolute paths  Contents NOT deleted on undeploy  Possible uses: • Providing common content to multiple web applications from a single location • Providing alternative paths to resources when embedding (e.g. WEB-INF/lib) 17
  • 18. Tomcat 7 – Manager application  Correct use of GET and POST  CSRF protection • HTML interface only  Text interface moved • /manager to /manager/text  Split roles • manager-gui (HTML GUI) • manager-scripts (text interface for Ant, Maven etc) • manager-jmx (JMX proxy) • manager-status (just the status page)  Memory leak detection • Stopped, reloaded or un-deployed web applications • Has to trigger a full GC to detect the leak 18
  • 19. Tomcat 7 – Embedded improvements  Based on work by Costin  Single class can create a Tomcat instance in a few lines of code • org.apache.catalina.startup.Tomcat  Very easy to embed • Tomcat uses it as the basis of most of the Tomcat 7 unit tests  ‘Bare bones’ and ‘usual defaults’ options  Full programmatic access to Tomcat internals  Smaller number of JARs 19
  • 20. Tomcat 7 – Other improvements and changes  Prevent session fixation attacks • Session ID changed on authentication  Logging improvements • OneLineFormatter • VerbatimFormatter • AsyncFileHandler  Lots of internal code clean-up • Use of generics • Removed unused code • StringBuffer replaced with StringBuilder • Loggers made final and static where possible • Reduce code duplication in the connectors  Start switch from Valves to Filters 20
  • 21. Tomcat 7 – Other improvements and changes  Generic CSRF protection  Access log enabled by default  LockOut Realm configured by default  Align JMX Beans with code • GSoC 2010 • Start with just a <Server .../> element in server.xml • Configure everything else via JMX 21
  • 22. Tomcat 7 – Plans  JSP 196 implementation • The Java Authentication SPI for Containers (Servlet Container Profile)  Enhancements to the memory leak protection  Simpler configuration of JNDI resources  Integration with Windows Authentication  Fewer open bugs  More frequent releases  Review outstanding enhancement requests 22
  • 23. Tomcat 7 – Plans  Implementing the Java EE 6 web profile is not on the roadmap • No-one is asking for it • Geronimo is in a better position to provide it • Tomcat team will monitor demand and review this regularly 23
  • 25. Current status  First release on 29 June 2010  Current release is 7.0.2  7.0.x still considered to be in beta 25
  • 27. Useful resources  http://tomcat.apache.org • http://tomcat.apache.org/download-70.cgi • http://tomcat.apache.org/tomcat-7.0-doc/index.html  http://tomcat.apache.org/migration.html  https://svn.apache.org/repos/asf/tomcat/trunk  git://git.apache.org/tomcat70.git  announce@tomcat.apache.org • Very low traffic  users@tomcat.apache.org  Usage questions  dev@tomcat.apache.org  Code changes only 27
  • 28. Questions 28