SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Java	
  EE	
  Servlet/JSP	
  Tutorial

                                                       Second cookbook, getting started with Model 2: Servlet and JSP
                                                       Implementing the Edit/Update, Add




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Cookbook:	
  Intro	
  to	
  Serlvets	
  and	
  JSP
              • This cookbook in the Java EE Servlet /JSP tutorial
                       covers building CRUD Operations in a Model 2
                       architecture

              • This is a continuation of Building a simple listing in
                       JSP using Java EE and Servlets (Part 1).

              • This	
  is	
  part	
  2,	
  must	
  do	
  part	
  1	
  first
                • Part	
  1	
  Slides
              • Covers	
  working	
  with	
  Servlet	
  doGet/doPost	
  methods,	
  JSTL,	
  
                       redirec8on	
  versus	
  forwarding




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Redux:	
  About	
  tutorial
              • Very	
  liNle	
  knowledge	
  of	
  HTML,	
  Java	
  and	
  JSP	
  is	
  assumed
              • HTML	
  and	
  Java	
  not	
  covered	
  length,	
  but	
  pointers	
  in	
  the	
  right	
  
                       direc8on	
  

              • Focus	
  is	
  Java	
  Servlets	
  and	
  JSP	
  (Java	
  Server	
  Pages)
              • Use	
  whatever	
  IDE	
  you	
  would	
  like,	
  but	
  direc8ons	
  focus	
  on	
  
                       Eclipse




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Redux:	
  App	
  you	
  are	
  building
                                                                                                                                    Sorting




                                                                                                                                              Remove




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Outline
           • 1 Java EE Servlet Tutorial: Implementing a basic CRUD listing
           • 2 Adding a link to the book listing to edit a book
              • 2.1 Adding an edit book link to book-list.jsp listing
           • 3 Adding a link to the book listing to add a book
              • 3.1 Adding an add book link to book-list.jsp listing
           • 4 Servlet doGet to load a Book form
              • 4.1 BookEditorServlet.java doGet
              • 4.2 BookEditorServlet.java doGet() delegate to book-form.jsp page
              • 4.3 BookEditorServlet.java doGet() delegate to book-form.jsp page
           • 5 Rendering the book form HTML
              • 5.1 book-form.jsp Renders form to update or add a Book
              • 5.2 book-form.jsp using JSTL c:choose to display update or add status
              • 5.3 book-form.jsp using JSTL c:if to hidden id field for edit/update operation
           • 6 Creating a doPost method to handle the form submission
              • 6.1 BookEditorServlet.java doPost
           • 7 Quick review of what we have so far
              • 7.1 ./WebContent/WEB-INF/pages/book-form.jsp full listing
              • 7.2 ./WebContent/WEB-INF/pages/book-list.jsp full listing
              • 7.3 ./src/META-INF/beans.xml full listing
              • 7.4 ./src/com/bookstore/Book.java
              • 7.5 ./src/com/bookstore/BookRepositoryImpl.java full listing (testing only)
              • 7.6 ./src/com/bookstore/BookRepository.java full listing
              • 7.7 ./src/com/bookstore/web/BookEditorServlet.java
              • 7.8 ./src/com/bookstore/web/BookListServlet.java
           • 8 Technical debt
           • 9 Cookbooks and Tutorials

Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Where	
  we	
  leX	
  off	
  in	
  last	
  example
              • BookListServlet	
  uses	
  a	
  BookRepository	
  object	
  (DAO)	
  to	
  load	
  a	
  
                       list	
  of	
  books	
  

              • BookListServlet	
  then	
  delegated	
  to	
  book-­‐list.jsp	
  to	
  render	
  the	
  
                       book	
  lis8ng	
  with	
  JSTL	
  and	
  Unified	
  EL

              • In	
  this	
  cookbook,	
  
                       • add	
  a	
  link	
  to	
  the	
  book	
  lis9ng	
  for	
  edi9ng	
  a	
  book
                       • add	
  a	
  link	
  so	
  that	
  the	
  end	
  user	
  can	
  add	
  a	
  new	
  book	
  to	
  the	
  lis9ng
                       • Create	
  backend	
  Servlets	
  to	
  handle	
  new	
  links	
  on	
  book	
  lis9ng




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Model	
  2	
  MVC
Model                                                                                                              View                          Controller
                                                                                                                                                   •BookListingServlet
  •Book                                                                                                                 •book-form.jsp             •BookEditorServlet
  •BookRepositoryImpl                                                                                                   •book-list.jsp
  •BookRepository




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Add	
  a	
  new	
  link	
  to	
  book-­‐lis8ng.jsp
             • Add	
  link	
  to	
  edit	
  opera8on
             • Edit	
  opera8on	
  pulls	
  up	
  form	
  with	
  details	
  of	
  Book	
  8tle	
  that	
  is	
  clicked
             • Uses	
  <a	
  href=””
             • Uses	
  expression	
  pageContext.request.contextPath/book	
  to	
  address	
  new	
  Edit	
  Servlet
             • Servlet	
  created	
  later,	
  id	
  parameter	
  implies	
  edit	
  opertaion
             • EL	
  expression	
  pageContext.request.contextPath	
  refers	
  to	
  the	
  URI,	
  web	
  app	
  (war	
  file)	
  is	
  
                       mapped	
  to	
  in	
  Servlet	
  container




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Edit	
  Link	
  on	
  Title




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
What	
  gets	
  rendered
             • The	
  following	
  links	
  with	
  URI	
  (/bookstore)	
  of	
  webapp	
  get	
  rendered	
  when	
  book-­‐
                       lis8ng.jsp	
  loads




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Adding	
  a	
  “add	
  a	
  book”	
  link	
  to	
  book	
  lis8ng




     • Now	
  that	
  links	
  are	
  going	
  to	
  URI	
  /book,	
  
     • You	
  need	
  a	
  Servlet	
  that	
  handles	
  links
       • For	
  add	
  opera9on	
  and	
  edit	
  opera9on
     • New	
  BookEditorServlet	
  will	
  handle	
  both	
  add	
  and	
  edit	
  book	
  func8ons




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Add	
  Link	
  Above	
  Table




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
BookEditorServlet
              • @WebServlet("/book")	
  maps	
  BookEditorServlet	
  to	
  the	
  URI	
  /
                       book

              • Common	
  to	
  load	
  a	
  form	
  from	
  a	
  doGet	
  method,	
  and	
  to	
  handle	
  
                       the	
  form	
  submission	
  via	
  doPost

              • Follows	
  REST	
  and	
  HTTP	
  principles	
  GET	
  opera8ons	
  reads	
  data,	
  
                       • later	
  POST	
  data	
  modifies	
  data
              • doGet	
  method	
  uses	
  id	
  being	
  empty	
  or	
  not	
  to	
  
                       • determine	
  if	
  this	
  is	
  a	
  load	
  "Add	
  Book	
  Form"	
  or	
  
                       • load	
  "Update	
  Book	
  Form"	
  opera9on




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
BookEditorServlet




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
BookEditorServlet.doGet	
  loads	
  edit/add	
  form
                                                                                                                                    Add Link


                                                                                                                                    Edit Link




                                                                                                     doGet is load form operation


                                                                                                                                                book-form.jsp




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Model	
  2	
  and	
  BookEditorServlet.doGet
             • In	
  Model	
  2,	
  Servlets	
  (controllers/ac8ons)	
  prepares	
  model	
  data	
  for	
  the	
  view
             • This	
  includes	
  date	
  formagng




                                                   Notice “book” is mapped into request scope

                                                   “book” will get used from book-form.jsp




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Model	
  2	
  and	
  BookEditorServlet.doGet	
  (cont)
             • To	
  render	
  the	
  HTML	
  form,	
  the	
  servlet	
  delegates	
  to	
  book-­‐form.jsp




                                                                                                                                    book-form.jsp




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
book-­‐form.jsp	
  (1	
  of	
  3)
             • book-­‐form.jsp	
  renders	
  form	
  to	
  edit	
  book	
  
             • If	
  book.id	
  present	
  then	
  edit	
  opera8on,	
  otherwise	
  add	
  opera8on
               • JSTL	
  c:choose,	
  c:otherwise	
  to	
  display	
  correct	
  9tle	
  based	
  on	
  Update	
  (Edit)	
  or	
  Add	
  
                                 opera9on




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
book-­‐form.jsp	
  (2	
  of	
  3)
             • Uses	
  Unified	
  EL	
  to	
  render	
  values	
  and	
  then	
  just	
  plain	
  HTML	
  for	
  form	
  fields




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
book-­‐form.jsp	
  (3	
  of	
  3)
             • hidden	
  id	
  property	
  is	
  rendered	
  if	
  edit	
  (Update)	
  opera8on
             • Cancel	
  buNon	
  takes	
  them	
  back	
  to	
  lis8ng	
  (/book/	
  is	
  lis8ng).
             • Submit	
  buNon	
  POST	
  form	
  to	
  BookEditorServlet.doPost	
  (defined	
  next)




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
BookEditorServlet.doPost()
              • if	
  id	
  request	
  parameter	
  is	
  null	
  then	
  BookEditorServlet.doPost	
  
                       calls	
  bookRepo.addBook,	
  
                       • otherwise	
  it	
  calls	
  bookRepo.updateBook
              • 	
  Then,	
  doPost	
  redirects	
  to	
  /book/
                       • redirect	
  means	
  an	
  extra	
  hit	
  to	
  the	
  server,	
  
                       • basically	
  telling	
  browser	
  to	
  load	
  another	
  link
                       • Not	
  forward	
  like	
  before	
  because	
  of	
  bookmarking
                       • Remember	
  URL	
  /book/	
  (ending	
  in	
  slash)	
  represents	
  a	
  collec9on	
  of	
  
                                 books,	
  while	
  /book	
  (no	
  slash)	
  represents	
  a	
  single	
  book	
  
                       • If	
  doPost	
  did	
  a	
  forward,	
  then	
  browser	
  would	
  show	
  wrong	
  link	
  for	
  
                                 lis9ng
                       • Use	
  sendRedirect	
  instead	
  of	
  a	
  forward	
  for	
  bookmarking


Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
BookEditorServlet.doPost()




Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
BookEditorServlet.doPost
                                                                                                                                                      book-form.jsp




                                                                                                                                    BookListServlet
Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Review	
  of	
  CRUD	
  lis8ng
  • Book	
  Form
                                                                                      • Servlet	
  that	
  loads	
  Book	
  (doGet)	
  form	
  
    • ./WebContent/WEB-­‐INF/pages/book-­‐form.jsp	
  	
  	
  	
  	
  	
  	
  	
  	
   and	
  handles	
  Book	
  form	
  submissions	
  
                                                                                                                                                                      (doPost).
  • Book	
  Lis8ng
    • ./WebContent/WEB-­‐INF/pages/book-­‐list.jsp	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   ./src/com/bookstore/web/
                                                                                                                                                                      BookEditorServlet.java	
  	
  	
  	
  	
  	
  
  • Needed	
  for	
  Java	
  EE	
  dependency	
  injec8on	
  (CDI)
    • ./src/META-­‐INF/beans.xml	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   • Servlet	
  that	
  looks	
  up	
  a	
  list	
  of	
  books	
  and	
  
                                                                                                                                                                      displays	
  the	
  lis8ng
  • Domain/model	
  object
                                                                                                                                                                      ./src/com/bookstore/web/
    • ./src/com/bookstore/Book.java	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
     BookListServlet.java	
  	
  	
  	
  	
  	
  	
  	
  	
  

  • Repository	
  implementa8on	
  using	
  Java	
  collec8ons	
  
           (just	
  for	
  tes8ng)
           • ./src/com/bookstore/BookRepositoryImpl.java	
  	
  	
  	
  	
  	
  	
  	
  
  • Interface	
  to	
  Book	
  Repository	
  so	
  we	
  can	
  swap	
  it	
  out	
  
           with	
  JDBC,	
  JPA,	
  JCache	
  and	
  MongoDB	
  version	
  later
           • ./src/com/bookstore/BookRepository.java	
  	
  	
  	
  	
  	
  	
  
Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server
Open%Source,%Reliable%and%Lightweight%
       Java%EE%Applica;on%Server%




RESIN PRO   Web Profile   Health System   Cloud Support
More	
  Info

         • Caucho	
  Technology	
  |	
  Home	
  Page
         • Resin	
  |	
  Applica8on	
  Server
         • Resin	
  |	
  Java	
  EE	
  Web	
  Profile	
  Applica8on	
  Server
         • Resin	
  -­‐	
  Cloud	
  Support	
  |	
  3G	
  -­‐	
  Java	
  Clustering
         • Resin	
  |	
  Java	
  CDI	
  |	
  Dependency	
  Injec8on	
  /	
  IoC
         • Resin	
  -­‐	
  Health	
  System	
  |	
  Java	
  Monitoring	
  and	
  Server	
  Monitoring
         • Download	
  Resin	
  |	
  Applica8on	
  Server
         • Watch	
  Resin	
  |	
  Applica8on	
  Server	
  Featured	
  Video

Caucho	
  Home	
  	
  |	
  	
  Contact	
  Us	
  	
  |	
  	
  Caucho	
  Blog	
  	
  |	
  	
  Wiki	
  	
  |	
  Applica8on	
  Server

Contenu connexe

Tendances

Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan Edstrom
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache CamelClaus Ibsen
 
ActiveMQ Performance Tuning
ActiveMQ Performance TuningActiveMQ Performance Tuning
ActiveMQ Performance TuningChristian Posta
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache CamelKenneth Peeples
 
Apache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationApache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationClaus Ibsen
 
Profiling JavaScript Performance
Profiling JavaScript PerformanceProfiling JavaScript Performance
Profiling JavaScript PerformanceFITC
 
Polyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQPolyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQChristian Posta
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
 
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter LedbrookJava Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter LedbrookJAX London
 
Apache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxApache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxClaus Ibsen
 
Crank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBoxCrank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBoxJim Crossley
 
Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011tobiascrawley
 
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Matt Raible
 
HyperLight Websites
HyperLight WebsitesHyperLight Websites
HyperLight WebsitesFITC
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Ryan Cuprak
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingRami Sayar
 
A year in the life of a Grails startup
A year in the life of a Grails startupA year in the life of a Grails startup
A year in the life of a Grails startuptomaslin
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelIoan Eugen Stan
 

Tendances (20)

Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache Camel
 
ActiveMQ Performance Tuning
ActiveMQ Performance TuningActiveMQ Performance Tuning
ActiveMQ Performance Tuning
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache Camel
 
Apache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentationApache Camel - FUSE community day London 2010 presentation
Apache Camel - FUSE community day London 2010 presentation
 
Profiling JavaScript Performance
Profiling JavaScript PerformanceProfiling JavaScript Performance
Profiling JavaScript Performance
 
Polyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQPolyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQ
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter LedbrookJava Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
Java Tech & Tools | Grails in the Java Enterprise | Peter Ledbrook
 
Apache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxApache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the box
 
Crank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBoxCrank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBox
 
Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011Torquebox @ Charlotte.rb May 2011
Torquebox @ Charlotte.rb May 2011
 
Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015Developing, Testing and Scaling with Apache Camel - UberConf 2015
Developing, Testing and Scaling with Apache Camel - UberConf 2015
 
HyperLight Websites
HyperLight WebsitesHyperLight Websites
HyperLight Websites
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
 
A year in the life of a Grails startup
A year in the life of a Grails startupA year in the life of a Grails startup
A year in the life of a Grails startup
 
WebSocket protocol
WebSocket protocolWebSocket protocol
WebSocket protocol
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache Camel
 

En vedette

Web Component Development with Servlet and JSP Technologies Unit 01
Web Component Development with Servlet and JSP Technologies Unit 01Web Component Development with Servlet and JSP Technologies Unit 01
Web Component Development with Servlet and JSP Technologies Unit 01Prashanth Shivakumar
 
Iaetsd a survey of various design patterns for improving quality and
Iaetsd a survey of various design patterns for improving quality andIaetsd a survey of various design patterns for improving quality and
Iaetsd a survey of various design patterns for improving quality andIaetsd Iaetsd
 
Model-Driven Development of Web Applications
Model-Driven Development of Web ApplicationsModel-Driven Development of Web Applications
Model-Driven Development of Web Applicationsidescitation
 
J2ee (java ee) tutorial for beginners
J2ee (java ee) tutorial for beginnersJ2ee (java ee) tutorial for beginners
J2ee (java ee) tutorial for beginnersinTwentyEight Minutes
 
Web engineering 2(lect 0)
Web engineering 2(lect 0)Web engineering 2(lect 0)
Web engineering 2(lect 0)Roohul Amin
 
Web engineering 2(lect 2)
Web engineering 2(lect 2)Web engineering 2(lect 2)
Web engineering 2(lect 2)Roohul Amin
 
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....Paco Valverde
 
Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2Novencia Groupe
 
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)JavaEE Trainers
 
Basic Version Control Using Git - Bengkel Gamelan
Basic Version Control Using Git - Bengkel GamelanBasic Version Control Using Git - Bengkel Gamelan
Basic Version Control Using Git - Bengkel GamelangamelanYK
 
2D Art Dalam Video Game - Kudit
2D Art Dalam Video Game  -  Kudit2D Art Dalam Video Game  -  Kudit
2D Art Dalam Video Game - KuditGusti Aditya P
 
Online Security - The Good, the Bad, and the Crooks
Online Security - The Good, the Bad, and the CrooksOnline Security - The Good, the Bad, and the Crooks
Online Security - The Good, the Bad, and the CrooksSteven Davis
 
Presentasi seminar mobile games
Presentasi seminar mobile gamesPresentasi seminar mobile games
Presentasi seminar mobile gamesDennis Ganda
 
Bengkel 6 pengetahuan dasar audio pada game (1)
Bengkel 6 pengetahuan dasar audio pada game (1)Bengkel 6 pengetahuan dasar audio pada game (1)
Bengkel 6 pengetahuan dasar audio pada game (1)gamelanYK
 
5 steps into creating your first mobile game
5 steps into creating your first mobile game5 steps into creating your first mobile game
5 steps into creating your first mobile gameDennis Adriansyah Ganda
 
Bengkel Gamelan : Press Release 101
Bengkel Gamelan : Press Release 101Bengkel Gamelan : Press Release 101
Bengkel Gamelan : Press Release 101Dennis Ganda
 

En vedette (20)

Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
 
Web Component Development with Servlet and JSP Technologies Unit 01
Web Component Development with Servlet and JSP Technologies Unit 01Web Component Development with Servlet and JSP Technologies Unit 01
Web Component Development with Servlet and JSP Technologies Unit 01
 
Iaetsd a survey of various design patterns for improving quality and
Iaetsd a survey of various design patterns for improving quality andIaetsd a survey of various design patterns for improving quality and
Iaetsd a survey of various design patterns for improving quality and
 
Model-Driven Development of Web Applications
Model-Driven Development of Web ApplicationsModel-Driven Development of Web Applications
Model-Driven Development of Web Applications
 
J2ee (java ee) tutorial for beginners
J2ee (java ee) tutorial for beginnersJ2ee (java ee) tutorial for beginners
J2ee (java ee) tutorial for beginners
 
Servidores web
Servidores webServidores web
Servidores web
 
Web engineering 2(lect 0)
Web engineering 2(lect 0)Web engineering 2(lect 0)
Web engineering 2(lect 0)
 
Jsp 2 Research Methods
Jsp 2 Research MethodsJsp 2 Research Methods
Jsp 2 Research Methods
 
Web engineering 2(lect 2)
Web engineering 2(lect 2)Web engineering 2(lect 2)
Web engineering 2(lect 2)
 
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
 
Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2Créer une application web en asp.net mvc 2
Créer une application web en asp.net mvc 2
 
Web engineering (2)
Web engineering (2)Web engineering (2)
Web engineering (2)
 
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
 
Basic Version Control Using Git - Bengkel Gamelan
Basic Version Control Using Git - Bengkel GamelanBasic Version Control Using Git - Bengkel Gamelan
Basic Version Control Using Git - Bengkel Gamelan
 
2D Art Dalam Video Game - Kudit
2D Art Dalam Video Game  -  Kudit2D Art Dalam Video Game  -  Kudit
2D Art Dalam Video Game - Kudit
 
Online Security - The Good, the Bad, and the Crooks
Online Security - The Good, the Bad, and the CrooksOnline Security - The Good, the Bad, and the Crooks
Online Security - The Good, the Bad, and the Crooks
 
Presentasi seminar mobile games
Presentasi seminar mobile gamesPresentasi seminar mobile games
Presentasi seminar mobile games
 
Bengkel 6 pengetahuan dasar audio pada game (1)
Bengkel 6 pengetahuan dasar audio pada game (1)Bengkel 6 pengetahuan dasar audio pada game (1)
Bengkel 6 pengetahuan dasar audio pada game (1)
 
5 steps into creating your first mobile game
5 steps into creating your first mobile game5 steps into creating your first mobile game
5 steps into creating your first mobile game
 
Bengkel Gamelan : Press Release 101
Bengkel Gamelan : Press Release 101Bengkel Gamelan : Press Release 101
Bengkel Gamelan : Press Release 101
 

Similaire à Java EE Servlet/JSP Tutorial- Cookbook 2

Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Josh Juneau
 
Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Rajesh Moorjani
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactChen-Tien Tsai
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfAlfresco Software
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online TrainingLearntek1
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxKulbir4
 
What is flux architecture in react
What is flux architecture in reactWhat is flux architecture in react
What is flux architecture in reactBOSC Tech Labs
 
04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframeworkErhwen Kuo
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with ChefJohn Osborne
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EEJ On The Beach
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EEMarkus Eisele
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music storeADEEBANADEEM
 
005432796.pdf
005432796.pdf005432796.pdf
005432796.pdfEidTahir
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesLauren Yew
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Wen-Tien Chang
 
reactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdfreactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdfAkshitkumar437417
 

Similaire à Java EE Servlet/JSP Tutorial- Cookbook 2 (20)

Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
 
Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00
 
Coursejspservlets00
Coursejspservlets00Coursejspservlets00
Coursejspservlets00
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + react
 
Show Some Spine!
Show Some Spine!Show Some Spine!
Show Some Spine!
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsx
 
What is flux architecture in react
What is flux architecture in reactWhat is flux architecture in react
What is flux architecture in react
 
Taverna as a service
Taverna as a serviceTaverna as a service
Taverna as a service
 
04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframework
 
Dev-Friendly Ops
Dev-Friendly OpsDev-Friendly Ops
Dev-Friendly Ops
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EE
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
005432796.pdf
005432796.pdf005432796.pdf
005432796.pdf
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
 
reactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdfreactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdf
 

Dernier

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
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Dernier (20)

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
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Java EE Servlet/JSP Tutorial- Cookbook 2

  • 1. Java  EE  Servlet/JSP  Tutorial Second cookbook, getting started with Model 2: Servlet and JSP Implementing the Edit/Update, Add Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 2. Cookbook:  Intro  to  Serlvets  and  JSP • This cookbook in the Java EE Servlet /JSP tutorial covers building CRUD Operations in a Model 2 architecture • This is a continuation of Building a simple listing in JSP using Java EE and Servlets (Part 1). • This  is  part  2,  must  do  part  1  first • Part  1  Slides • Covers  working  with  Servlet  doGet/doPost  methods,  JSTL,   redirec8on  versus  forwarding Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 3. Redux:  About  tutorial • Very  liNle  knowledge  of  HTML,  Java  and  JSP  is  assumed • HTML  and  Java  not  covered  length,  but  pointers  in  the  right   direc8on   • Focus  is  Java  Servlets  and  JSP  (Java  Server  Pages) • Use  whatever  IDE  you  would  like,  but  direc8ons  focus  on   Eclipse Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 4. Redux:  App  you  are  building Sorting Remove Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 5. Outline • 1 Java EE Servlet Tutorial: Implementing a basic CRUD listing • 2 Adding a link to the book listing to edit a book • 2.1 Adding an edit book link to book-list.jsp listing • 3 Adding a link to the book listing to add a book • 3.1 Adding an add book link to book-list.jsp listing • 4 Servlet doGet to load a Book form • 4.1 BookEditorServlet.java doGet • 4.2 BookEditorServlet.java doGet() delegate to book-form.jsp page • 4.3 BookEditorServlet.java doGet() delegate to book-form.jsp page • 5 Rendering the book form HTML • 5.1 book-form.jsp Renders form to update or add a Book • 5.2 book-form.jsp using JSTL c:choose to display update or add status • 5.3 book-form.jsp using JSTL c:if to hidden id field for edit/update operation • 6 Creating a doPost method to handle the form submission • 6.1 BookEditorServlet.java doPost • 7 Quick review of what we have so far • 7.1 ./WebContent/WEB-INF/pages/book-form.jsp full listing • 7.2 ./WebContent/WEB-INF/pages/book-list.jsp full listing • 7.3 ./src/META-INF/beans.xml full listing • 7.4 ./src/com/bookstore/Book.java • 7.5 ./src/com/bookstore/BookRepositoryImpl.java full listing (testing only) • 7.6 ./src/com/bookstore/BookRepository.java full listing • 7.7 ./src/com/bookstore/web/BookEditorServlet.java • 7.8 ./src/com/bookstore/web/BookListServlet.java • 8 Technical debt • 9 Cookbooks and Tutorials Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 6. Where  we  leX  off  in  last  example • BookListServlet  uses  a  BookRepository  object  (DAO)  to  load  a   list  of  books   • BookListServlet  then  delegated  to  book-­‐list.jsp  to  render  the   book  lis8ng  with  JSTL  and  Unified  EL • In  this  cookbook,   • add  a  link  to  the  book  lis9ng  for  edi9ng  a  book • add  a  link  so  that  the  end  user  can  add  a  new  book  to  the  lis9ng • Create  backend  Servlets  to  handle  new  links  on  book  lis9ng Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 7. Model  2  MVC Model View Controller •BookListingServlet •Book •book-form.jsp •BookEditorServlet •BookRepositoryImpl •book-list.jsp •BookRepository Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 8. Add  a  new  link  to  book-­‐lis8ng.jsp • Add  link  to  edit  opera8on • Edit  opera8on  pulls  up  form  with  details  of  Book  8tle  that  is  clicked • Uses  <a  href=”” • Uses  expression  pageContext.request.contextPath/book  to  address  new  Edit  Servlet • Servlet  created  later,  id  parameter  implies  edit  opertaion • EL  expression  pageContext.request.contextPath  refers  to  the  URI,  web  app  (war  file)  is   mapped  to  in  Servlet  container Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 9. Edit  Link  on  Title Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 10. What  gets  rendered • The  following  links  with  URI  (/bookstore)  of  webapp  get  rendered  when  book-­‐ lis8ng.jsp  loads Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 11. Adding  a  “add  a  book”  link  to  book  lis8ng • Now  that  links  are  going  to  URI  /book,   • You  need  a  Servlet  that  handles  links • For  add  opera9on  and  edit  opera9on • New  BookEditorServlet  will  handle  both  add  and  edit  book  func8ons Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 12. Add  Link  Above  Table Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 13. BookEditorServlet • @WebServlet("/book")  maps  BookEditorServlet  to  the  URI  / book • Common  to  load  a  form  from  a  doGet  method,  and  to  handle   the  form  submission  via  doPost • Follows  REST  and  HTTP  principles  GET  opera8ons  reads  data,   • later  POST  data  modifies  data • doGet  method  uses  id  being  empty  or  not  to   • determine  if  this  is  a  load  "Add  Book  Form"  or   • load  "Update  Book  Form"  opera9on Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 14. BookEditorServlet Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 15. BookEditorServlet.doGet  loads  edit/add  form Add Link Edit Link doGet is load form operation book-form.jsp Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 16. Model  2  and  BookEditorServlet.doGet • In  Model  2,  Servlets  (controllers/ac8ons)  prepares  model  data  for  the  view • This  includes  date  formagng Notice “book” is mapped into request scope “book” will get used from book-form.jsp Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 17. Model  2  and  BookEditorServlet.doGet  (cont) • To  render  the  HTML  form,  the  servlet  delegates  to  book-­‐form.jsp book-form.jsp Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 18. book-­‐form.jsp  (1  of  3) • book-­‐form.jsp  renders  form  to  edit  book   • If  book.id  present  then  edit  opera8on,  otherwise  add  opera8on • JSTL  c:choose,  c:otherwise  to  display  correct  9tle  based  on  Update  (Edit)  or  Add   opera9on Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 19. book-­‐form.jsp  (2  of  3) • Uses  Unified  EL  to  render  values  and  then  just  plain  HTML  for  form  fields Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 20. book-­‐form.jsp  (3  of  3) • hidden  id  property  is  rendered  if  edit  (Update)  opera8on • Cancel  buNon  takes  them  back  to  lis8ng  (/book/  is  lis8ng). • Submit  buNon  POST  form  to  BookEditorServlet.doPost  (defined  next) Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 21. BookEditorServlet.doPost() • if  id  request  parameter  is  null  then  BookEditorServlet.doPost   calls  bookRepo.addBook,   • otherwise  it  calls  bookRepo.updateBook •  Then,  doPost  redirects  to  /book/ • redirect  means  an  extra  hit  to  the  server,   • basically  telling  browser  to  load  another  link • Not  forward  like  before  because  of  bookmarking • Remember  URL  /book/  (ending  in  slash)  represents  a  collec9on  of   books,  while  /book  (no  slash)  represents  a  single  book   • If  doPost  did  a  forward,  then  browser  would  show  wrong  link  for   lis9ng • Use  sendRedirect  instead  of  a  forward  for  bookmarking Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 22. BookEditorServlet.doPost() Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 23. BookEditorServlet.doPost book-form.jsp BookListServlet Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 24. Review  of  CRUD  lis8ng • Book  Form • Servlet  that  loads  Book  (doGet)  form   • ./WebContent/WEB-­‐INF/pages/book-­‐form.jsp                   and  handles  Book  form  submissions   (doPost). • Book  Lis8ng • ./WebContent/WEB-­‐INF/pages/book-­‐list.jsp                           ./src/com/bookstore/web/ BookEditorServlet.java             • Needed  for  Java  EE  dependency  injec8on  (CDI) • ./src/META-­‐INF/beans.xml                                                                                 • Servlet  that  looks  up  a  list  of  books  and   displays  the  lis8ng • Domain/model  object ./src/com/bookstore/web/ • ./src/com/bookstore/Book.java                                                                 BookListServlet.java                   • Repository  implementa8on  using  Java  collec8ons   (just  for  tes8ng) • ./src/com/bookstore/BookRepositoryImpl.java                 • Interface  to  Book  Repository  so  we  can  swap  it  out   with  JDBC,  JPA,  JCache  and  MongoDB  version  later • ./src/com/bookstore/BookRepository.java               Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server
  • 25. Open%Source,%Reliable%and%Lightweight% Java%EE%Applica;on%Server% RESIN PRO Web Profile Health System Cloud Support
  • 26. More  Info • Caucho  Technology  |  Home  Page • Resin  |  Applica8on  Server • Resin  |  Java  EE  Web  Profile  Applica8on  Server • Resin  -­‐  Cloud  Support  |  3G  -­‐  Java  Clustering • Resin  |  Java  CDI  |  Dependency  Injec8on  /  IoC • Resin  -­‐  Health  System  |  Java  Monitoring  and  Server  Monitoring • Download  Resin  |  Applica8on  Server • Watch  Resin  |  Applica8on  Server  Featured  Video Caucho  Home    |    Contact  Us    |    Caucho  Blog    |    Wiki    |  Applica8on  Server