SlideShare a Scribd company logo
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

More Related Content

What's hot

Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
Johan Edstrom
 
Developing Microservices with Apache Camel
Developing Microservices with Apache CamelDeveloping Microservices with Apache Camel
Developing Microservices with Apache Camel
Claus 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 2017
Matthew Groves
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache Camel
Kenneth 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 presentation
Claus Ibsen
 
Profiling JavaScript Performance
Profiling JavaScript PerformanceProfiling JavaScript Performance
Profiling JavaScript Performance
FITC
 
Polyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQPolyglot Messaging with Apache ActiveMQ
Polyglot Messaging with Apache ActiveMQ
Christian 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 Ledbrook
JAX 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 box
Claus Ibsen
 
Crank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBoxCrank Up Your Apps With TorqueBox
Crank Up Your Apps With TorqueBox
Jim 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 2015
Matt Raible
 
HyperLight Websites
HyperLight WebsitesHyperLight Websites
HyperLight Websites
FITC
 
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 Debugging
Rami 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
 
WebSocket protocol
WebSocket protocolWebSocket protocol
WebSocket protocol
Kensaku Komatsu
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache Camel
Ioan Eugen Stan
 

What's hot (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
 

Viewers also liked

Jsp chapter 1
Jsp chapter 1Jsp chapter 1
Jsp chapter 1
kamal kotecha
 
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
Prashanth 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 and
Iaetsd Iaetsd
 
Model-Driven Development of Web Applications
Model-Driven Development of Web ApplicationsModel-Driven Development of Web Applications
Model-Driven Development of Web Applications
idescitation
 
J2ee (java ee) tutorial for beginners
J2ee (java ee) tutorial for beginnersJ2ee (java ee) tutorial for beginners
J2ee (java ee) tutorial for beginners
inTwentyEight Minutes
 
Servidores web
Servidores webServidores web
Servidores web
Othon Oliveira
 
Web engineering 2(lect 0)
Web engineering 2(lect 0)Web engineering 2(lect 0)
Web engineering 2(lect 0)Roohul Amin
 
Jsp 2 Research Methods
Jsp 2 Research MethodsJsp 2 Research Methods
Jsp 2 Research Methods
King AbdulAziz University
 
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 Gamelan
gamelanYK
 
2D Art Dalam Video Game - Kudit
2D Art Dalam Video Game  -  Kudit2D Art Dalam Video Game  -  Kudit
2D Art Dalam Video Game - Kudit
Gusti 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 Crooks
Steven 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 game
Dennis Adriansyah Ganda
 
Bengkel Gamelan : Press Release 101
Bengkel Gamelan : Press Release 101Bengkel Gamelan : Press Release 101
Bengkel Gamelan : Press Release 101
Dennis Ganda
 

Viewers also liked (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
 

Similar to 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 10
Josh Juneau
 
Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Rajesh Moorjani
 
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
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + react
Chen-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 Surf
Alfresco Software
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
Learntek1
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsx
Kulbir4
 
What is flux architecture in react
What is flux architecture in reactWhat is flux architecture in react
What is flux architecture in react
BOSC Tech Labs
 
Taverna as a service
Taverna as a serviceTaverna as a service
Taverna as a service
Rafael C. Jimenez
 
04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframework
Erhwen Kuo
 
Dev-Friendly Ops
Dev-Friendly OpsDev-Friendly Ops
Dev-Friendly Ops
Josh Schramm
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
John Osborne
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
Markus Eisele
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EE
J On The Beach
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
ADEEBANADEEM
 
005432796.pdf
005432796.pdf005432796.pdf
005432796.pdf
EidTahir
 
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
Lauren 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
 

Similar to 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
 
Coursejspservlets00
Coursejspservlets00Coursejspservlets00
Coursejspservlets00
 
Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00Jeetrainers.com coursejspservlets00
Jeetrainers.com coursejspservlets00
 
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
 
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
 

Recently uploaded

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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
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
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
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
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
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
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
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
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
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
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
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
 

Recently uploaded (20)

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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
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
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
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...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
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 -...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
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 Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
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
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
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
 

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