SlideShare a Scribd company logo
1
<Insert Picture Here>




Servlet 3.0, Asynchronous, Easy extensible

Rajiv Mordani
rajiv.mordani@oracle.com
The following is intended to outline our general product
direction. It is intended for information purposes only,
and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing
decisions.
The development, release, and timing of any features or
functionality described for Oracle’s products remains at the
sole discretion of Oracle.


                                                               3
Agenda


•   Overview
•   Ease of Development
•   Dynamic registration
•   Pluggability
•   Asynchronous Support
•   Security Enhancements
•   Miscellaneous


                            4
Overview


• Final release done in December 2009.
• ~20 members in the expert group
   – Good mix of representation from major Java EE
     vendors, open source web container developers and
     framework authors
• Main areas of focus
   – Ease of Development
   – Pluggability
   – Asynchronous support
   – Security                                            5
Ease of Development


• Focus on Ease of Development in the Servlet 3.0 API
• Enhanced APIs to use new Java SE language features
  introduced since J2SE 5.0
• Annotations for declarative style of programming
   – web.xml optional
• Generics for type safety in API where possible
• Better defaults
• Convention over configuration

                                                        6
Ease of Development
Use of annotations

• Annotations to declare Servlets, Filters, Listeners and
  servlet security
   – @WebServlet – Define a Servlet
   – @WebFilter - Define a Filter
   – @WebListener – Define a Listener
   – @WebInitParam – Define init param
   – @MultipartConfig – Define file upload properties
   – @ServletSecurity – Define security constraints
• Can use web.xml to override values specified in
  annotations                                               7
Ease of Development
Use of annotations (contd)

• @WebServlet for defining a Servlet
   – Annotations MUST have at a minimum a URL pattern
     for the Servlet
   – All other attributes optional with reasonable defaults
   – For example, the default name of the Servlet is the
     fully qualified class name
   – Class MUST still extend HttpServlet
   – Method contracts for doGet, doPost (and others)
     derived from HttpServlet
                                                              8
Servlet 2.5 example
At least 2 files

<!--Deployment         /* Code in Java Class
 descriptor web.xml    */
 -->
<web-app>              package com.sun;
 <servlet>             public           clas s
   <servlet-           MyServlet     extend s
 name>MyServlet        HttpServlet
          </servlet-   {
name>                      public void
       <servlet-
class>                 doGet(HttpServletRequ
                                                 9
Servlet 3.0 example


@WebServlet(“/foo”)
public class SimpleSample extends
HttpServlet
{
    public void doGet(HttpServletRequest
              req,HttpServletResponse res)
    {

    }
}                                            10
Servlet 3.0 example


@WebServlet(urlPatterns=“/foo”,
name=”MyServlet”, asyncSupported=true)
public class SimpleSample extends
HttpServlet
{
    public void doGet(HttpServletRequest
              req,HttpServletResponse res)
    {

    }                                        11
Dynamic Registration
Register

• Performed during ServletContext initialization
• ServletContext#add[Servlet | Filter]
   – Overloaded versions take [Servlet | Filter] name and
      • Fully qualified [Servlet | Filter] class name or
      • Class <? extends [Servlet | Filter]> or
      • [Servlet | Filter] instance
   – User returned Registration handle to configure all
     aspects of [Servlet | Filter]

                                                            12
Dynamic Registration
Create and register

• ServletContext#create[Servlet | Filter]
   – Takes Class<? Extends [Servlet | Filter]>
     argument
   – Supports resource injection by container
   – Returned [Servlet | Filter] instance may be fully
     customized before it is registered via the
      • ServletContext.add[Servlet | Filter]
        methods


                                                         13
Dynamic Registration
Lookup

• ServletContext#get[Servlet |
  Filter]Registration
   – Takes [Servlet | Filter] name as argument
   – Returned Registration handle provides subset of
     configuration methods
   – May only be used to add initialization parameters and
     mappings
   – Conflict returned as
      • java.util.Set

                                                             14
Dynamic Registration
Register example

ServletRegistration.Dynamic dynamic =
    servletContext.addServlet(
        "DynamicServlet",
        "com.mycom.MyServlet");
dynamic.addMapping("/dynamicServlet");
dynamic.setAsyncSupported(true);




                                         15
Dynamic Registration
Lookup example

ServletRegistration declared =
servletContext.getServletRegistration("Decl
aredServlet");
declared.addMapping("/declaredServlet");
declared.setInitParameter("param",
"value");




                                              16
Pluggability


• Enable use of libraries and framework without boiler
  plate configuration in deployment descriptors
   – Put the burden on the framework developer
• Modularize web.xml to allow frameworks to be self-
  contained within their own JAR file
• Programmatic configuration APIs
• Use of annotations



                                                         17
Pluggability
Motivation for web.xml modularization

• Use of framework requires (possibly complex)
  configuration in web.xml
• For example
   – Declare a controller Servlet
   – Logging and security Filters
   – Declare Listeners to perform actions at various points
     in the lifecycle of the application
• Can get complex as dependencies increase
• Frameworks also need to document all the configuration
  that needs to be done                                       18
Pluggability
web-fragment.xml

• web-fragment.xml is descriptor for framework / library
• Included in META-INF directory
• Container responsible for discovering fragments and
  assembling the effective deployment descriptor
• Almost identical to web.xml
   – Ordering related elements different
• Only JAR files in WEB-INF/lib considered as
  fragments


                                                           19
Pluggability
web-fragment.xml

<web-fragment>
  <servlet>
    <servlet-name>welcome</servlet-name>
    <servlet-class>
       WelcomeServlet
    </servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>welcome</servlet-name>
    <url-pattern>/Welcome</url-pattern>
  </servlet-mapping>
                                           20
Pluggability
Ordering

• Compatible with JavaServer™ Faces
• Fragments identified by <name>
• web.xml may declare absolute ordering of fragments
  via <absolute-ordering>
• Fragments may declare ordering preferences relative to
  other fragments via <ordering> with nested <before>
  and <after>
   – Ignored if <absolute-ordering> specified
• Special <others/> element moves fragment to
  beginning or end of list of sorted fragments
                                                           21
Pluggability
Shared libraries

• Support plugging in of container installed JAR files
   – Examples: JSF, JAX-WS, Spring
• Libraries may provide implementation of
  ServletContainerInitializer
• Looked up via the JAR Services API in JDK 6
• Invoked before any Listeners during the initialization of
  the application



                                                              22
Pluggability
Shared libraries (contd)

• ServletContainerInitializer expresses interest
  in Classes via @HandlesTypes
• Container discovers classes that match
  @HandlesTypes and passes them to
  ServletContainerInitializer
• ServletContainerInitializer inspects passed in
  Classes and may register Servlets and Filters based on
  them


                                                           23
Pluggability
ServletContainerInitializer example

@HandlesTypes(WebService.class)
public class JAXWSInitializer implements
ServletContainerInitializer {
  public void onStartup(Set<Class<?>> c,
                        ServletContext ctx)
  {
    ctx.addServlet(“JAXWSServlet”,
             “com.sun.jaxws.JAXWSServlet”);

   }
                                              24
Pluggability
Resource sharing

• Static and JavaServer™ Pages (JSP) resources no
  longer confined to web application's document root
• May be placed inside WEB-INF/lib/[*.jar]/META-
  INF/resources
• Container must honor this new location when processing
  HTTP requests and calls to
  ServletContext#getResource[AsStream]
• Resources in document root take precedence over those
  in bundled JAR files

                                                           25
Pluggability
Resource sharing example

mywebapp.war packaging:
 /index.jsp
 /WEB-INF/lib/shared.jar!/META-
INF/resources/shared.jsp
Request for:
http://localhost:8080/mywebapp/shared.jsp
will be served from:
/path/to/mywebapp/WEB-
INF/lib/shared.jar!/META-
INF/resources/shared.jsp                    26
Why Asynchronous Servlets?


• Async Servlets are for:
  – Waiting for resources (eg JDBC connection)
  – Waiting for events (eg Chat)
  – Waiting for responses (eg web services)
• Not for Async IO!
  – Requests mostly small (single packet)
  – Hard to asynchronously produce large responses
  – Async IO support waiting for NIO2

                                                     27
Blocking waiting consumes resources


• Web Application using remote web services
  – Handling 1000 requests / sec
  – 50% requests call remote web service
  – 500 threads in container thread pool

• If remote web service is slow (1000ms)
   – Thread starvation in 1 second!
   – 50% of requests use all 500 threads

                                              28
Asynchronous API
Enable asynchronous support

• ServletRequest#isAsyncSupported()
   – True if ALL [Filter|Servlet]s support async in
      • the Filter chain
      • the RequestDispatch chain
• Configured in
   – web.xml
      • <async-supported>true</async-
        supported>
   – With annotation
      • @WebServlet(asyncSupported=true)              29
Asynchronous API
Start asynchronous processing

• AsyncContext ServletRequest#startAsync()
   – Called by [Filter|Servlet]
   – Response is NOT commited on return of:
     • Servlet.service(request,response)
     • Filter chain
• AsyncContext ServletRequest#startAsync
                                (ServletRequest
  req,
                                 ServletResponse
  res)
                                                   30
Asynchronous API
AsyncContext

• AsyncContext#dispatch()
   – Called by your asynchronous handler
   – Schedule async dispatch:DispatcherType.ASYNC
   – Response generated by [Filter|Servlet] using:
     • container thread pool
     • JSP, JSF or other frameworks usable
     • JNDI, JTA, EJBs usable

• AsyncContext#dispatch(String path)
   – Variation to async dispatch to specific Servlet   31
Asynchronous API
AsyncContext (contd)

• AsyncContext#complete()
   – Called by your asynchronous handler
   – Signals Response has been generated
     • without [Filter|Servlet] dispatch
     • without Servlet features
     • Or with AsyncContext#start(Runnable r)




                                                32
Asynchronous API usage styles


• startAsync()                  … dispatch()
   – Retry request after async wait
   – Filters re-applied if on DispatcherType.ASYNC

• startAsync()                … dispatch(path)
   – Use specific Servlet handling after async wait

• startAsync()             … complete()
   – Generate response asynchronously
                                                      33
Asynchronous API usage styles


• startAsync(req,res) … dispatch()
   – Retry request after async wait
   – Wrappers are kept
   – RequestDispatcher#forward target used

• startAsync(req,res) … dispatch(path)
   – Specific Servlet handling after async wait

• startAsync(req,res) … complete()
   – Generate wrapped response asynchronously     34
Asynchronous API
Timeout

• Timeouts
   – AsyncContext#setAsyncTimeout(long ms)
   – By default error dispatch on timeout

• Listeners
   – AsyncListener#OnTimeout
   – AsyncListener#OnComplete



                                             35
Security
Annotations to define security constraints

• @ServletSecurity used to define access control
  constraints
• Can specify constraint for all HTTP methods via the
  @HttpConstraint
• Or specify constraint for specific HTTP methods via the
  @HttpMethodConstraint
• If both specified in the @ServletSecurity, the
  @HttpConstraint applies to those methods not
  specifically specified via the @HttpMethodConstraint

                                                            36
Security
Example

@ServletSecurity((httpMethodConstraints = {
@HttpMethodConstraint(value = "GET",
rolesAllowed = "R1"),
@HttpMethodConstraint(value = "POST",
rolesAllowed = "R1",
transportGuarantee =
TransportGuarantee.CONFIDENTIAL)
})
public class Example5 extends HttpServlet {
}                                             37
Security
Programmatic container authentication and logout

• HttpServletRequest#login(String username,
  String password)
   – Replacement for FBL
   – Application supervises credential collection
• HttpServletRequest#authenticate(HttpServle
  tResponse)
   – Application initiates container mediated authentication
     from a resource that is not covered by any
     authentication constraints
   – Application decides when authentication must occur
                                                               38
Security
Programmatic container authentication and logout

• Integration of additional container authentication
  modules via Servlet Profile of JSR 196 recommended
• HttpServletRequest#logout




                                                       39
Miscellaneous Features / API enhancements


• Session tracking cookie configuration
  – Via web.xml
  – Programmatic via
    javax.servlet.SessionCookieConfig
• Support for HttpOnly cookie attribute
  – Example:
    servletContext.getSessionCookieConfig().
    setHttpOnly(true)
• Default error page
                                               40
Miscellaneous Features / API enhancements (contd)


• ServletRequest#getServletContext
• ServletRequest#getDispatcherType
• Servlet[Request|
  Response]Wrapper#isWrapperFor
• HttpServletResponse#getStatus
• HttpServletResponse#getHeader
• HttpServletResponse#getHeaders
• HttpServletResponse#getHeaderNames

                                                    41
Miscellaneous Features / API (contd)
File upload

•   ServletRequest#getParts
•   ServletRequest#getPart
•   @MultipartConfig
•   Changes to web.xml




                                       42
Summary


• Major revision since Servlet 2.4
• Comprehensive set of new features enable modern style
  of web applications and greatly increases developer
  productivity
• Simplifies assembly of large applications from reusable
  components




                                                            43
Resources


• http://jcp.org/en/jsr/summary?id=315
• https://glassfish.dev.java.net
• http://java.sun.com/javaee




                                         44
Q&A




      45
<Insert Picture Here>




Servlet 3.0, Asynchronous, Easy extensible

Rajiv Mordani
rajiv.mordani@oracle.com

More Related Content

What's hot

Learn Oracle WebLogic Server 12c Administration
Learn Oracle WebLogic Server 12c AdministrationLearn Oracle WebLogic Server 12c Administration
Learn Oracle WebLogic Server 12c Administration
Revelation Technologies
 
Weblogic 11g admin basic with screencast
Weblogic 11g admin basic with screencastWeblogic 11g admin basic with screencast
Weblogic 11g admin basic with screencast
Rajiv Gupta
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postvamsi krishna
 
Weblogic Administration Managed Server migration
Weblogic Administration Managed Server migrationWeblogic Administration Managed Server migration
Weblogic Administration Managed Server migration
Rakesh Gujjarlapudi
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsJames Bayer
 
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12cOracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
frankmunz
 
Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008
JavaEE Trainers
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
C2B2 Consulting
 
WebLogic Administration course outline
WebLogic Administration course outlineWebLogic Administration course outline
WebLogic Administration course outlineVybhava Technologies
 
Weblogic server administration
Weblogic server administrationWeblogic server administration
Weblogic server administration
bispsolutions
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
Michel Schildmeijer
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
Ryan Cuprak
 
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
J V
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuning
lovingprince58
 
Advanced liferay architecture clustering and high availability
Advanced liferay architecture clustering and high availabilityAdvanced liferay architecture clustering and high availability
Advanced liferay architecture clustering and high availabilityBordin Kijsirijareonchai
 
WebLogic Deployment Plan Example
WebLogic Deployment Plan ExampleWebLogic Deployment Plan Example
WebLogic Deployment Plan Example
James Bayer
 

What's hot (20)

Learn Oracle WebLogic Server 12c Administration
Learn Oracle WebLogic Server 12c AdministrationLearn Oracle WebLogic Server 12c Administration
Learn Oracle WebLogic Server 12c Administration
 
Tomcatx performance-tuning
Tomcatx performance-tuningTomcatx performance-tuning
Tomcatx performance-tuning
 
Weblogic 11g admin basic with screencast
Weblogic 11g admin basic with screencastWeblogic 11g admin basic with screencast
Weblogic 11g admin basic with screencast
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
 
Weblogic Administration Managed Server migration
Weblogic Administration Managed Server migrationWeblogic Administration Managed Server migration
Weblogic Administration Managed Server migration
 
Oracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic ConceptsOracle WebLogic Server Basic Concepts
Oracle WebLogic Server Basic Concepts
 
Oracle WebLogic 11g Topology
Oracle WebLogic 11g TopologyOracle WebLogic 11g Topology
Oracle WebLogic 11g Topology
 
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12cOracle WebLogic: Feature Timeline from WLS9 to WLS 12c
Oracle WebLogic: Feature Timeline from WLS9 to WLS 12c
 
Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
 
WebLogic Administration course outline
WebLogic Administration course outlineWebLogic Administration course outline
WebLogic Administration course outline
 
Weblogic server administration
Weblogic server administrationWeblogic server administration
Weblogic server administration
 
WebLogic FAQs
WebLogic FAQsWebLogic FAQs
WebLogic FAQs
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
WLS
WLSWLS
WLS
 
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
 
Tomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance TuningTomcat Optimisation & Performance Tuning
Tomcat Optimisation & Performance Tuning
 
Advanced liferay architecture clustering and high availability
Advanced liferay architecture clustering and high availabilityAdvanced liferay architecture clustering and high availability
Advanced liferay architecture clustering and high availability
 
WebLogic Deployment Plan Example
WebLogic Deployment Plan ExampleWebLogic Deployment Plan Example
WebLogic Deployment Plan Example
 

Viewers also liked

Sarah grier passport1
Sarah grier passport1Sarah grier passport1
Sarah grier passport1Janet Painter
 
Cregg Laws having+what+it+takes
Cregg Laws having+what+it+takesCregg Laws having+what+it+takes
Cregg Laws having+what+it+takesJanet Painter
 
Power Csba
Power CsbaPower Csba
Power Csba
BrianWoodland
 
Alex global+education
Alex global+educationAlex global+education
Alex global+educationJanet Painter
 
Healthcare Reform Seminar May 2010
Healthcare Reform Seminar May 2010Healthcare Reform Seminar May 2010
Healthcare Reform Seminar May 2010cliff_rudolph
 
leadership beyond words-nspra
leadership beyond words-nspraleadership beyond words-nspra
leadership beyond words-nspra
BrianWoodland
 
JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0
Arun Gupta
 

Viewers also liked (7)

Sarah grier passport1
Sarah grier passport1Sarah grier passport1
Sarah grier passport1
 
Cregg Laws having+what+it+takes
Cregg Laws having+what+it+takesCregg Laws having+what+it+takes
Cregg Laws having+what+it+takes
 
Power Csba
Power CsbaPower Csba
Power Csba
 
Alex global+education
Alex global+educationAlex global+education
Alex global+education
 
Healthcare Reform Seminar May 2010
Healthcare Reform Seminar May 2010Healthcare Reform Seminar May 2010
Healthcare Reform Seminar May 2010
 
leadership beyond words-nspra
leadership beyond words-nspraleadership beyond words-nspra
leadership beyond words-nspra
 
JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0
 

Similar to Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010

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
JavaEE Trainers
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Arun Gupta
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
Minal Maniar
 
JAVA Servlets
JAVA ServletsJAVA Servlets
JAVA Servlets
deepak kumar
 
Servlets
ServletsServlets
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postvamsitricks
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postvamsitricks
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jspJafar Nesargi
 
UNIT-3 Servlet
UNIT-3 ServletUNIT-3 Servlet
UNIT-3 Servlet
ssbd6985
 
Wt unit 3
Wt unit 3 Wt unit 3
Wt unit 3
team11vgnt
 
ADP - Chapter 2 Exploring the java Servlet Technology
ADP - Chapter 2 Exploring the java Servlet TechnologyADP - Chapter 2 Exploring the java Servlet Technology
ADP - Chapter 2 Exploring the java Servlet Technology
Riza Nurman
 
18CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-318CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-3
sivakumarmcs
 
Servlets
ServletsServlets
Java Servlets
Java ServletsJava Servlets
Java ServletsNitin Pai
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
Gary Yeh
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3
JavaEE Trainers
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Tushar B Kute
 

Similar to Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010 (20)

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
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
JAVA Servlets
JAVA ServletsJAVA Servlets
JAVA Servlets
 
Servlets
ServletsServlets
Servlets
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
 
Servletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,postServletarchitecture,lifecycle,get,post
Servletarchitecture,lifecycle,get,post
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
UNIT-3 Servlet
UNIT-3 ServletUNIT-3 Servlet
UNIT-3 Servlet
 
Wt unit 3
Wt unit 3 Wt unit 3
Wt unit 3
 
ADP - Chapter 2 Exploring the java Servlet Technology
ADP - Chapter 2 Exploring the java Servlet TechnologyADP - Chapter 2 Exploring the java Servlet Technology
ADP - Chapter 2 Exploring the java Servlet Technology
 
18CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-318CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-3
 
Servlets
ServletsServlets
Servlets
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
 
19servlets
19servlets19servlets
19servlets
 
Servlets
ServletsServlets
Servlets
 

More from Arun Gupta

5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf
Arun Gupta
 
Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019
Arun Gupta
 
Machine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and Kubernetes
Arun Gupta
 
Secure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using Firecracker
Arun Gupta
 
Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019
Arun Gupta
 
Why Amazon Cares about Open Source
Why Amazon Cares about Open SourceWhy Amazon Cares about Open Source
Why Amazon Cares about Open Source
Arun Gupta
 
Machine learning using Kubernetes
Machine learning using KubernetesMachine learning using Kubernetes
Machine learning using Kubernetes
Arun Gupta
 
Building Cloud Native Applications
Building Cloud Native ApplicationsBuilding Cloud Native Applications
Building Cloud Native Applications
Arun Gupta
 
Chaos Engineering with Kubernetes
Chaos Engineering with KubernetesChaos Engineering with Kubernetes
Chaos Engineering with Kubernetes
Arun Gupta
 
How to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAMHow to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAM
Arun Gupta
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
Arun Gupta
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 Keynote
Arun Gupta
 
Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018
Arun Gupta
 
Mastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv SummitMastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv Summit
Arun Gupta
 
Top 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's LandscapeTop 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's Landscape
Arun Gupta
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017
Arun Gupta
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Arun Gupta
 
Docker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developers
Arun Gupta
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!
Arun Gupta
 
Migrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersMigrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to Containers
Arun Gupta
 

More from Arun Gupta (20)

5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf
 
Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019
 
Machine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and Kubernetes
 
Secure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using Firecracker
 
Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019
 
Why Amazon Cares about Open Source
Why Amazon Cares about Open SourceWhy Amazon Cares about Open Source
Why Amazon Cares about Open Source
 
Machine learning using Kubernetes
Machine learning using KubernetesMachine learning using Kubernetes
Machine learning using Kubernetes
 
Building Cloud Native Applications
Building Cloud Native ApplicationsBuilding Cloud Native Applications
Building Cloud Native Applications
 
Chaos Engineering with Kubernetes
Chaos Engineering with KubernetesChaos Engineering with Kubernetes
Chaos Engineering with Kubernetes
 
How to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAMHow to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAM
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 Keynote
 
Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018
 
Mastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv SummitMastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv Summit
 
Top 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's LandscapeTop 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's Landscape
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShift
 
Docker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developers
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!
 
Migrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersMigrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to Containers
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010

  • 1. 1
  • 2. <Insert Picture Here> Servlet 3.0, Asynchronous, Easy extensible Rajiv Mordani rajiv.mordani@oracle.com
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 3
  • 4. Agenda • Overview • Ease of Development • Dynamic registration • Pluggability • Asynchronous Support • Security Enhancements • Miscellaneous 4
  • 5. Overview • Final release done in December 2009. • ~20 members in the expert group – Good mix of representation from major Java EE vendors, open source web container developers and framework authors • Main areas of focus – Ease of Development – Pluggability – Asynchronous support – Security 5
  • 6. Ease of Development • Focus on Ease of Development in the Servlet 3.0 API • Enhanced APIs to use new Java SE language features introduced since J2SE 5.0 • Annotations for declarative style of programming – web.xml optional • Generics for type safety in API where possible • Better defaults • Convention over configuration 6
  • 7. Ease of Development Use of annotations • Annotations to declare Servlets, Filters, Listeners and servlet security – @WebServlet – Define a Servlet – @WebFilter - Define a Filter – @WebListener – Define a Listener – @WebInitParam – Define init param – @MultipartConfig – Define file upload properties – @ServletSecurity – Define security constraints • Can use web.xml to override values specified in annotations 7
  • 8. Ease of Development Use of annotations (contd) • @WebServlet for defining a Servlet – Annotations MUST have at a minimum a URL pattern for the Servlet – All other attributes optional with reasonable defaults – For example, the default name of the Servlet is the fully qualified class name – Class MUST still extend HttpServlet – Method contracts for doGet, doPost (and others) derived from HttpServlet 8
  • 9. Servlet 2.5 example At least 2 files <!--Deployment /* Code in Java Class descriptor web.xml */ --> <web-app> package com.sun; <servlet> public clas s <servlet- MyServlet extend s name>MyServlet HttpServlet </servlet- { name> public void <servlet- class> doGet(HttpServletRequ 9
  • 10. Servlet 3.0 example @WebServlet(“/foo”) public class SimpleSample extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) { } } 10
  • 11. Servlet 3.0 example @WebServlet(urlPatterns=“/foo”, name=”MyServlet”, asyncSupported=true) public class SimpleSample extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) { } 11
  • 12. Dynamic Registration Register • Performed during ServletContext initialization • ServletContext#add[Servlet | Filter] – Overloaded versions take [Servlet | Filter] name and • Fully qualified [Servlet | Filter] class name or • Class <? extends [Servlet | Filter]> or • [Servlet | Filter] instance – User returned Registration handle to configure all aspects of [Servlet | Filter] 12
  • 13. Dynamic Registration Create and register • ServletContext#create[Servlet | Filter] – Takes Class<? Extends [Servlet | Filter]> argument – Supports resource injection by container – Returned [Servlet | Filter] instance may be fully customized before it is registered via the • ServletContext.add[Servlet | Filter] methods 13
  • 14. Dynamic Registration Lookup • ServletContext#get[Servlet | Filter]Registration – Takes [Servlet | Filter] name as argument – Returned Registration handle provides subset of configuration methods – May only be used to add initialization parameters and mappings – Conflict returned as • java.util.Set 14
  • 15. Dynamic Registration Register example ServletRegistration.Dynamic dynamic = servletContext.addServlet( "DynamicServlet", "com.mycom.MyServlet"); dynamic.addMapping("/dynamicServlet"); dynamic.setAsyncSupported(true); 15
  • 16. Dynamic Registration Lookup example ServletRegistration declared = servletContext.getServletRegistration("Decl aredServlet"); declared.addMapping("/declaredServlet"); declared.setInitParameter("param", "value"); 16
  • 17. Pluggability • Enable use of libraries and framework without boiler plate configuration in deployment descriptors – Put the burden on the framework developer • Modularize web.xml to allow frameworks to be self- contained within their own JAR file • Programmatic configuration APIs • Use of annotations 17
  • 18. Pluggability Motivation for web.xml modularization • Use of framework requires (possibly complex) configuration in web.xml • For example – Declare a controller Servlet – Logging and security Filters – Declare Listeners to perform actions at various points in the lifecycle of the application • Can get complex as dependencies increase • Frameworks also need to document all the configuration that needs to be done 18
  • 19. Pluggability web-fragment.xml • web-fragment.xml is descriptor for framework / library • Included in META-INF directory • Container responsible for discovering fragments and assembling the effective deployment descriptor • Almost identical to web.xml – Ordering related elements different • Only JAR files in WEB-INF/lib considered as fragments 19
  • 20. Pluggability web-fragment.xml <web-fragment> <servlet> <servlet-name>welcome</servlet-name> <servlet-class> WelcomeServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>welcome</servlet-name> <url-pattern>/Welcome</url-pattern> </servlet-mapping> 20
  • 21. Pluggability Ordering • Compatible with JavaServer™ Faces • Fragments identified by <name> • web.xml may declare absolute ordering of fragments via <absolute-ordering> • Fragments may declare ordering preferences relative to other fragments via <ordering> with nested <before> and <after> – Ignored if <absolute-ordering> specified • Special <others/> element moves fragment to beginning or end of list of sorted fragments 21
  • 22. Pluggability Shared libraries • Support plugging in of container installed JAR files – Examples: JSF, JAX-WS, Spring • Libraries may provide implementation of ServletContainerInitializer • Looked up via the JAR Services API in JDK 6 • Invoked before any Listeners during the initialization of the application 22
  • 23. Pluggability Shared libraries (contd) • ServletContainerInitializer expresses interest in Classes via @HandlesTypes • Container discovers classes that match @HandlesTypes and passes them to ServletContainerInitializer • ServletContainerInitializer inspects passed in Classes and may register Servlets and Filters based on them 23
  • 24. Pluggability ServletContainerInitializer example @HandlesTypes(WebService.class) public class JAXWSInitializer implements ServletContainerInitializer { public void onStartup(Set<Class<?>> c, ServletContext ctx) { ctx.addServlet(“JAXWSServlet”, “com.sun.jaxws.JAXWSServlet”); } 24
  • 25. Pluggability Resource sharing • Static and JavaServer™ Pages (JSP) resources no longer confined to web application's document root • May be placed inside WEB-INF/lib/[*.jar]/META- INF/resources • Container must honor this new location when processing HTTP requests and calls to ServletContext#getResource[AsStream] • Resources in document root take precedence over those in bundled JAR files 25
  • 26. Pluggability Resource sharing example mywebapp.war packaging: /index.jsp /WEB-INF/lib/shared.jar!/META- INF/resources/shared.jsp Request for: http://localhost:8080/mywebapp/shared.jsp will be served from: /path/to/mywebapp/WEB- INF/lib/shared.jar!/META- INF/resources/shared.jsp 26
  • 27. Why Asynchronous Servlets? • Async Servlets are for: – Waiting for resources (eg JDBC connection) – Waiting for events (eg Chat) – Waiting for responses (eg web services) • Not for Async IO! – Requests mostly small (single packet) – Hard to asynchronously produce large responses – Async IO support waiting for NIO2 27
  • 28. Blocking waiting consumes resources • Web Application using remote web services – Handling 1000 requests / sec – 50% requests call remote web service – 500 threads in container thread pool • If remote web service is slow (1000ms) – Thread starvation in 1 second! – 50% of requests use all 500 threads 28
  • 29. Asynchronous API Enable asynchronous support • ServletRequest#isAsyncSupported() – True if ALL [Filter|Servlet]s support async in • the Filter chain • the RequestDispatch chain • Configured in – web.xml • <async-supported>true</async- supported> – With annotation • @WebServlet(asyncSupported=true) 29
  • 30. Asynchronous API Start asynchronous processing • AsyncContext ServletRequest#startAsync() – Called by [Filter|Servlet] – Response is NOT commited on return of: • Servlet.service(request,response) • Filter chain • AsyncContext ServletRequest#startAsync (ServletRequest req, ServletResponse res) 30
  • 31. Asynchronous API AsyncContext • AsyncContext#dispatch() – Called by your asynchronous handler – Schedule async dispatch:DispatcherType.ASYNC – Response generated by [Filter|Servlet] using: • container thread pool • JSP, JSF or other frameworks usable • JNDI, JTA, EJBs usable • AsyncContext#dispatch(String path) – Variation to async dispatch to specific Servlet 31
  • 32. Asynchronous API AsyncContext (contd) • AsyncContext#complete() – Called by your asynchronous handler – Signals Response has been generated • without [Filter|Servlet] dispatch • without Servlet features • Or with AsyncContext#start(Runnable r) 32
  • 33. Asynchronous API usage styles • startAsync() … dispatch() – Retry request after async wait – Filters re-applied if on DispatcherType.ASYNC • startAsync() … dispatch(path) – Use specific Servlet handling after async wait • startAsync() … complete() – Generate response asynchronously 33
  • 34. Asynchronous API usage styles • startAsync(req,res) … dispatch() – Retry request after async wait – Wrappers are kept – RequestDispatcher#forward target used • startAsync(req,res) … dispatch(path) – Specific Servlet handling after async wait • startAsync(req,res) … complete() – Generate wrapped response asynchronously 34
  • 35. Asynchronous API Timeout • Timeouts – AsyncContext#setAsyncTimeout(long ms) – By default error dispatch on timeout • Listeners – AsyncListener#OnTimeout – AsyncListener#OnComplete 35
  • 36. Security Annotations to define security constraints • @ServletSecurity used to define access control constraints • Can specify constraint for all HTTP methods via the @HttpConstraint • Or specify constraint for specific HTTP methods via the @HttpMethodConstraint • If both specified in the @ServletSecurity, the @HttpConstraint applies to those methods not specifically specified via the @HttpMethodConstraint 36
  • 37. Security Example @ServletSecurity((httpMethodConstraints = { @HttpMethodConstraint(value = "GET", rolesAllowed = "R1"), @HttpMethodConstraint(value = "POST", rolesAllowed = "R1", transportGuarantee = TransportGuarantee.CONFIDENTIAL) }) public class Example5 extends HttpServlet { } 37
  • 38. Security Programmatic container authentication and logout • HttpServletRequest#login(String username, String password) – Replacement for FBL – Application supervises credential collection • HttpServletRequest#authenticate(HttpServle tResponse) – Application initiates container mediated authentication from a resource that is not covered by any authentication constraints – Application decides when authentication must occur 38
  • 39. Security Programmatic container authentication and logout • Integration of additional container authentication modules via Servlet Profile of JSR 196 recommended • HttpServletRequest#logout 39
  • 40. Miscellaneous Features / API enhancements • Session tracking cookie configuration – Via web.xml – Programmatic via javax.servlet.SessionCookieConfig • Support for HttpOnly cookie attribute – Example: servletContext.getSessionCookieConfig(). setHttpOnly(true) • Default error page 40
  • 41. Miscellaneous Features / API enhancements (contd) • ServletRequest#getServletContext • ServletRequest#getDispatcherType • Servlet[Request| Response]Wrapper#isWrapperFor • HttpServletResponse#getStatus • HttpServletResponse#getHeader • HttpServletResponse#getHeaders • HttpServletResponse#getHeaderNames 41
  • 42. Miscellaneous Features / API (contd) File upload • ServletRequest#getParts • ServletRequest#getPart • @MultipartConfig • Changes to web.xml 42
  • 43. Summary • Major revision since Servlet 2.4 • Comprehensive set of new features enable modern style of web applications and greatly increases developer productivity • Simplifies assembly of large applications from reusable components 43
  • 45. Q&A 45
  • 46. <Insert Picture Here> Servlet 3.0, Asynchronous, Easy extensible Rajiv Mordani rajiv.mordani@oracle.com