01-Overview-and-SetupDhrubojyotiKayal
Introducing ServletsInstalling Tomcat Installing EclipseYour first Java web applicationYour first ServletAgenda
Static HTML is so boring! – Dynamic content with ServletsA Java program that runs on a server. Follows a standard specification.Standard way to register servlet.Current version 3.0 (JSR 315)We focus on 2.5 (JSR 154) as 3.0 is very newServer forwards incoming request – headers, form data to registered servlet based on URL.Servlet processes data, generates new data and passes back to the server which in turn forwards it to the browserWhat is a servlet?
In ActionServletRDBMSBrowserServletServerJVM
EfficientUses threads not OS processes, one servlet instanceConvenientHigh level utility functionsPowerfulData processing, pooling, persistencePortableRuns on any OS where you get JVMInexpensiveBest in class open source servers to run servletsAdvantages
SecureNo hazards related to process managementPopularMost popular use of Java technologyMedium for large web apps of the scale of Google search Supported byApache, IBM, Oracle, Jetty, Coucho …..Runs onWindows, Unix, MacOS, VMS, IBM Mainframe OSUsed forAll kinds of applications – airline, hotels, banking, insurance …..Advantages
Hands On Exercise
Java web serverServlet reference implementationhttp://tomcat.apache.orgTomcat 7 – Servlet 3Tomcat 6 – Servlet 2.5DownloadInstallRunSee the web admin consoleShutdownTomcat
Eclipse IDE (http://www.eclipse.org)Open Source and supported by all biggies in Java businessEclipse 3.5 - GalileoBased on plug-in and OSGi coreFew essential plug-ins Install EclipseRun EclipseShutdown EclipseEclipse IDE
Setup new Tomcat 6 serverStart ServerStop ServerSetup Tomcat on Eclipse
Create workspaceCreate web application using EclipseThe project structure in EclipseNeed for web.xmlConfigure Tomcat 6 in EclipseWhat is deployed? – war fileStructure and contents of a blown up war fileManual deployment on TomcatDeploy using admin consoleFirst Web Application
Ah this web application does nothingLet us create the first servlet on EclipseWhat has changed on the web.xmlDeployWhat changes in the exploded war?Lets send a request for our servletHurray it respondsFirst servlet
Q&A

01 overview-servlets-and-environment-setup

  • 1.
  • 2.
    Introducing ServletsInstalling TomcatInstalling EclipseYour first Java web applicationYour first ServletAgenda
  • 3.
    Static HTML isso boring! – Dynamic content with ServletsA Java program that runs on a server. Follows a standard specification.Standard way to register servlet.Current version 3.0 (JSR 315)We focus on 2.5 (JSR 154) as 3.0 is very newServer forwards incoming request – headers, form data to registered servlet based on URL.Servlet processes data, generates new data and passes back to the server which in turn forwards it to the browserWhat is a servlet?
  • 4.
  • 5.
    EfficientUses threads notOS processes, one servlet instanceConvenientHigh level utility functionsPowerfulData processing, pooling, persistencePortableRuns on any OS where you get JVMInexpensiveBest in class open source servers to run servletsAdvantages
  • 6.
    SecureNo hazards relatedto process managementPopularMost popular use of Java technologyMedium for large web apps of the scale of Google search Supported byApache, IBM, Oracle, Jetty, Coucho …..Runs onWindows, Unix, MacOS, VMS, IBM Mainframe OSUsed forAll kinds of applications – airline, hotels, banking, insurance …..Advantages
  • 7.
  • 8.
    Java web serverServletreference implementationhttp://tomcat.apache.orgTomcat 7 – Servlet 3Tomcat 6 – Servlet 2.5DownloadInstallRunSee the web admin consoleShutdownTomcat
  • 9.
    Eclipse IDE (http://www.eclipse.org)OpenSource and supported by all biggies in Java businessEclipse 3.5 - GalileoBased on plug-in and OSGi coreFew essential plug-ins Install EclipseRun EclipseShutdown EclipseEclipse IDE
  • 10.
    Setup new Tomcat6 serverStart ServerStop ServerSetup Tomcat on Eclipse
  • 11.
    Create workspaceCreate webapplication using EclipseThe project structure in EclipseNeed for web.xmlConfigure Tomcat 6 in EclipseWhat is deployed? – war fileStructure and contents of a blown up war fileManual deployment on TomcatDeploy using admin consoleFirst Web Application
  • 12.
    Ah this webapplication does nothingLet us create the first servlet on EclipseWhat has changed on the web.xmlDeployWhat changes in the exploded war?Lets send a request for our servletHurray it respondsFirst servlet
  • 13.