JAVA? Millest räägime. Servlet, JSP. Hello World JAVA. JAVA - Versions. JAVA - primary goals. JAVA Web Container Servlet JSP
|
|
- Adrian Dean
- 8 years ago
- Views:
Transcription
1 Millest räägime Servlet, JSP Margus Hanni, Nortal AS JAVA Web Container Servlet JSP Hello World JAVA 1 2 #include <stdio.h> int main() { printf("hello World\n"); return 0; 3 4 public class HelloWorld { public static void main(string[] args) { System.out.println("Hello, World"); <? echo '<p>hello World</p>';?> <%= new String("Hello!") %> JAVA? JAVA - primary goals JAVA - Versions Five primary goals in the creation of the Java language: 1. It should use the object-oriented programming methodology. 2. It should allow the same program to be executed on multiple operating systems. 3. It should contain built-in support for using computer networks. 4. It should be designed to execute code from remote sources securely. 5. It should be easy to use by selecting what was considered the good parts of other object-oriented languages. Major release versions of Java, along with their release dates: JDK 1.0 (January 21, 1996) JDK 1.1 (February 19, 1997) J2SE 1.2 (December 8, 1998) J2SE 1.3 (May 8, 2000) J2SE 1.4 (February 6, 2002) J2SE 5.0 (September 30, 2004) Java SE 6 (December 11, 2006) Java SE 7 (July 28, 2011) Java SE 8 (March 18, 2014) 1
2 JAVA EE (Enterprise Edition) API - application programming interface Kogum vahendeid (API) erinevate lahenduste loomiseks: Veebi rakendused Veebi teenused Sõnumivahetus Andmebaasid Is a set of routines, protocols and tools for building software applications. Specifies ground rules Specifies how software components should interact with each ohter A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together JAVA EE Kogum vahendeid erinevate lahenduste loomiseks: Veebi rakendused Veebi teenused Sõnumivahetus Andmebaasis Web Container Servlet JSP Web Container Accepts requests, sends responses Manages component life cycles Routes requests to applications Web Containers Apache Tomcat JBoss WebLogic Jetty Glassfish Websphere Web Containers Multiple applications inside one container 2
3 Java source files Document root Static content 16 Configuration, executable code Deployment descriptor 3
4 Compiled classes Dependencies (JAR-s) Java Server Pages Deployment descriptor (web.xml) Instructs the container how to deal with this application <?xml version="1.0" encoding="utf-8"?> <web-app xmlns=" xmlns:xsi=" xsi:schemalocation=" version="3.0"> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app> Deployment descriptor (web.xml) In Servlet API version 3.0 most components of web.xml are replaced by annotations that go directly to Java source code. We will see examples later Servlets On JAVA klass, mis töötleb sissetulevat päringut ning tagastab vastuse Enamasti kasutatakse HTTP päringu töötlemiseks ja tulemuse saatmiseks Servletid töötavad veebikonteineris, mis hoolitseb nende elutsükli ning päringute suunamise eest javax.servlet.http.httpservlet abstraktne klass, mis sisaldab meetodeid doxxx HTTP päringute töötlemiseks 4
5 Servlet example public class HelloServlet extends HttpServlet { Servleti protected void doget(httpservletrequest req, HttpServletResponse resp) throws ServletException, IOException { PrintWriter writer = resp.getwriter(); writer.println("<html><head><title>hello</title></head><body>"); writer.println("<p>hello World!</p>"); writer.println("<p>current time: " + new Date() + "</p>"); writer.println("</body></html>"); Mis on tulemuseks? HttpServlet methods For each HTTP method there is corresponding HttpServlet method dopost doget doput Servlet Mapping Before Servlet 3.0 in web.xml <servlet> <servlet-name>hello</servlet-name> <servlet-class>example.helloservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> Example Servlet Mapping Servlet life cycle In Servlet 3.0 via public class HelloServlet extends HttpServlet {
6 Üldine servleti elutsükkel Sessions Kui veebikonteineris puudub Servleti instants Laetakse Servleti klass Luuakse isend Initsialiseeritakse (init meetod) Iga päringu jaoks kutsutakse välja service meetod. Servleti kustutamisel kutsutakse välja destroy meetod Kus on päringumeetodid? HTTP is a stateless protocol, but we often need the server to remember us between requests. There are some ways: Cookies URL rewriting Java HttpSession Java HttpSession HttpSession is a common interface for accessing session context Actual implementation is provided by a Web Container HttpSession example HttpSession example HttpSession session = req.getsession(); int visit; if (session.isnew()) { visit = 0; else { visit = (Integer) session.getattribute("visit"); session.setattribute("visit", ++visit); Either create a new HttpSession session = req.getsession(); session or get existing int visit; if (session.isnew()) { visit = 0; else { visit = (Integer) session.getattribute("visit"); session.setattribute("visit", ++visit); 6
7 HttpSession example HttpSession example HttpSession session = req.getsession(); int visit; if (session.isnew()) { Check if the session is fresh or not visit = 0; else { visit = (Integer) session.getattribute("visit"); session.setattribute("visit", ++visit); HttpSession session = req.getsession(); int visit; if (session.isnew()) { visit = 0; else { Retrieve attribute visit = (Integer) session.getattribute("visit"); session.setattribute("visit", ++visit); HttpSession example HttpServletRequest - Attribute HttpSession session = req.getsession(); int visit; if (session.isnew()) { visit = 0; else { visit = (Integer) session.getattribute("visit"); session.setattribute("visit", ++visit); Update attribute Contains request information Also can be used to store attributes request.setattribute( key", value); request.getattribute( key ); HttpServletRequest: Parameter request.getparameternames(); Enumeration<String> String value = request.getparameter("name"); HttpServletRequest: Parameter vs Attribute Object value = request.getattribute( key ); String value = request.getparameter("name"); 7
8 HttpServletRequest: meta data HttpServletRequest: headers request.getmethod(); GET, POST, request.getremoteaddr(); Remote client s IP request.getservletpath(); /path/to/servlet request.getheadernames(); Enumeration<String> request.getheader("user-agent"); Mozilla/5.0 (X11; Linux x86_64) Request Headers Request Headers: Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding gzip, deflate Accept-Language et,et-ee;q=0.8,en-us;q=0.5,en;q=0.3 Connection keep-alive JSESSIONID=C687CC4E2B25B8A27DAB4A5F ; Cookie utma= ; oracle.uix=0^^gmt+3:00^p Host localhost:8080 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) User-Agent Gecko/ Firefox/19.0 Cookie HttpServletRequest: cookies Small piece of information (some ID, parameter, preference etc..) Stored in browser Usually sent by a server Client sends only name-value pair JSESSIONID = C687CC4E2B25B8A27DAB4A5F language=en Cookie parameters: Name Value Expires Path Domain Security (can be sent over ssh only) HttpOnly Cookie[] cookies = request.getcookies(); cookie.getname(); cookie.getvalue(); cookie.setvalue( new value ); 8
9 Cookie: HttpServletResponse Allows to set response information response.setheader("content-type", "text/html"); response.addcookie(new Cookie("name", "value")); Response Headers Response Headers: Content-Language Content-Type Date Server Transfer-Encoding et text/html;charset=utf-8 Mon, 11 Mar :48:54 GMT Apache-Coyote/1.1 chunked Request < > Response: HttpServletResponse: content response.getwriter().println("..."); Write text response.getoutputstream().write(...); Write binary 9
10 package org.apache.jsp.web_002dinf.jsp.document; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import java.util.date; public final class testdokument_jsp extends org.apache.jasper.runtime.httpjspbase implements org.apache.jasper.runtime.jspsourcedependent { private static final javax.servlet.jsp.jspfactory _jspxfactory = javax.servlet.jsp.jspfactory.getdefaultfactory(); private static java.util.map<java.lang.string,java.lang.long> _jspx_dependants; private javax.el.expressionfactory _el_expressionfactory; private org.apache.tomcat.instancemanager _jsp_instancemanager; public java.util.map<java.lang.string,java.lang.long> getdependants() { return _jspx_dependants; public void _jspinit() { _el_expressionfactory = _jspxfactory.getjspapplicationcontext(getservletconfig().getservletcontext()).getexpressionfactory(); _jsp_instancemanager = org.apache.jasper.runtime.instancemanagerfactory.getinstancemanager(getservletconfig()); public void _jspdestroy() { public void _jspservice(final javax.servlet.http.httpservletrequest request, final javax.servlet.http.httpservletresponse response) throws java.io.ioexception, javax.servlet.servletexception { final javax.servlet.jsp.pagecontext pagecontext; javax.servlet.http.httpsession session = null; final javax.servlet.servletcontext application; final javax.servlet.servletconfig config; javax.servlet.jsp.jspwriter out = null; final java.lang.object page = this; javax.servlet.jsp.jspwriter _jspx_out = null; javax.servlet.jsp.pagecontext _jspx_page_context = null; try { response.setcontenttype("text/html; charset=utf-8"); pagecontext = _jspxfactory.getpagecontext(this, request, response, _jspx_page_context = pagecontext; application = pagecontext.getservletcontext(); config = pagecontext.getservletconfig(); session = pagecontext.getsession(); out = pagecontext.getout(); _jspx_out = out; out.write("\r\n"); out.write("\r\n"); out.write("<p>current time: "); out.print( new Date() ); out.write("</p>"); catch (java.lang.throwable t) { if (!(t instanceof javax.servlet.jsp.skippageexception)){ out = _jspx_out; if (out!= null && out.getbuffersize()!= 0) try { out.clearbuffer(); catch (java.io.ioexception e) { if (_jspx_page_context!= null) _jspx_page_context.handlepageexception(t); else throw new ServletException(t); finally { _jspxfactory.releasepagecontext(_jspx_page_context); null, true, 8192, true); Problem with servlets Java Server Pages (JSP) Writing HTML in Java is hideous PrintWriter writer = resp.getwriter(); writer.println("<html><head><title>hello</title></head><body>"); writer.println("<p>hello World!</p>"); writer.println("<p>current time: " + new Date() + "</p>"); writer.println("</body></html>"); Write HTML standard markup language Add dynamic scripting elements Add Java code JSP example JSP mapping war/web-inf/jsp/hello.jsp In web.xml <%@page import="java.util.date"%> <html> <head><title>hello</title></head> <body> <p>hello World!</p> <p>current time: <%= new Date() %></p> </body> </html> <servlet> <servlet-name>hello2</servlet-name> <jsp-file>/web-inf/jsp/hello.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>hello2</servlet-name> <url-pattern>/hello2</url-pattern> </servlet-mapping> JSP life cycle
11 Dynamic content Dynamic content Expression <p>current time: <%= new Date() %></p> Scriptlet <p>current time: <% out.println(new Date()); %></p> Declaration <%! private Date currentdate(){ return new Date(); %> <p>current time: <%= currentdate() %></p> JSP Eeldefineeritud muutujad JSP Märgendid request- HttpServletRequest response HttpServletResponse out Writer session HttpSession application ServletContext pagecontext PageContext jsp:include Veebipäring antakse ajutiselt üle teisele JSP lehele. jsp:forward Veebpäring antakse jäädavalt üle teisele JSP lehele. jsp:getproperty Loeb JavaBeani muutuja väärtuse. jsp:setproperty Määrab JavaBeani muutuja väärtuse. jsp:usebean Loob uue või taaskasutab JSP lehele kättesaadavat JavaBeani. Expression Language (EL) Easy way to access JavaBeans in different scopes Rea summa: ${rida.summa * rida.kogus Basic Operators in EL Operator Description. Access a bean property or Map entry [] Access an array or List element ( ) Group a subexpression to change the evaluation order + Addition - Subtraction or negation of a value * Multiplication / or div Division % or mod Modulo (remainder) == or eq Test for equality!= or ne Test for inequality < or lt Test for less than > or gt Test for greater than <= or le Test for less than or equal >= or gt Test for greater than or equal && or and Test for logical AND or or Test for logical OR! or not Unary Boolean complement empty Test for empty variable values 11
12 Scopes Many objects allow you to store attributes ServletRequest.setAttribute HttpSession.setAttribute ServletContext.setAttribute Andmete skoobid ServletContext veebikontekst, üks ühe rakenduse ja JVM-i kohta Sessioon üks iga kasutajasessiooni kohta (erinev lehitseja = erinev sessioon) Request konkreetse päringu skoop Andmete kirjutamiseks/lugemiseks on meetodid setattribute/getattribute Scopes Scopes <% application.setattribute("subject", "Web information systems"); session.setattribute("topic", "Servlets"); request.setattribute("lector", "Roman"); pagecontext.setattribute("lector", "Roman"); %> Subject: ${subject Topic: ${topic Lector: ${lector Väljund: Subject: Web information systems Topic: Servlets Lector: Roman Scopes Scopes <% application.setattribute("subject", "Web information systems"); session.setattribute("topic", "Servlets"); request.setattribute("lector", "Roman"); pagecontext.setattribute("lector", "Roman"); pagecontext.setattribute("subject", "Meie uus teema"); application.setattribute("subject", "Meie järgmine teema"); %> Subject: ${subject Topic: ${topic Lector: ${lector Mis on väljundiks? <% application.setattribute("subject", "Web information systems"); session.setattribute("topic", "Servlets"); request.setattribute("lector", "Roman"); pagecontext.setattribute("lector", "Roman"); pagecontext.setattribute("subject", "Meie uus teema"); application.setattribute("subject", "Meie järgmine teema"); %> Subject: ${subject Topic: ${topic Lector: ${lector Subject: Meie uus teema Topic: Servlets Lector: Roman 12
13 Scopes JavaBeans <% application.setattribute("subject", "Web information systems"); session.setattribute("topic", "Servlets"); request.setattribute("lector", "Roman"); pagecontext.setattribute("lector", "Roman"); Less visible %> Subject: ${subject Topic: ${topic Lector: ${lector public class Person implements Serializable { private String name; public Person() { public String getname() { return name; public void setname(string name) { this.name = name; Public default constructor Implements Serializable getx and setx methods for each property X JavaBeans in EL Person person = new Person(); person.setname("roman"); request.setattribute("person", person); <p>person: ${person.name</p> Java Standard Tag Library (JSTL) Set of standard tools for JSP <% List<String> lectors = Arrays.asList("Siim", "Roman", "Margus"); pagecontext.setattribute("lectors", lectors); %> <c:set var="guestlector" value="margus" /> <c:foreach var="lector" items="${lectors"> Name: ${lector <c:if test="${lector eq guestlector >(guest)</c:if> <br /> </c:foreach> Problem with JSP Writing Java in JSP is hideous <p>current time: <%= currentdate() %></p> Servlet + JSP JSP on puhtam Kihid on eraldatud Korduvkasutatavus Kuid kas saab paremini? Example 13
14 Model-View-Controller (MVC) Servlet controller, JSP view Controller gets invoked protected void doget(httpservletrequest req, HttpServletResponse resp) throws ServletException, IOException { req.setattribute("currentdate", new Date()); Model data req.getrequestdispatcher("/web-inf/jsp/hello.jsp").forward(req, resp); Servlet controller, JSP view Servlet controller, JSP view Controller gets invoked protected void doget(httpservletrequest req, HttpServletResponse resp) throws ServletException, IOException { req.setattribute("currentdate", new Date()); req.getrequestdispatcher("/web-inf/jsp/hello.jsp").forward(req, resp); Select and invoke view WEB-INF/jsp/hello.jsp <html>... <body> <p>current time: ${currentdate</p> </body> </html> View uses the data from model Filters Filter example Allows you to do something before, after or instead of servlet invocation. Filter chain public class LoggingFilter implements Filter { public void dofilter(servletrequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { long start = System.currentTimeMillis(); chain.dofilter(request, response); long end = System.currentTimeMillis(); System.out.println("Time spent: " + (end - start)); 14
15 Filter example Filter declaration public class LoggingFilter implements Filter { public void dofilter(servletrequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { long start = System.currentTimeMillis(); Invoke next filter in chain.dofilter(request, response); chain or the servlet if this was the last filter long end = System.currentTimeMillis(); System.out.println("Time spent: " + (end - start)); Before Servlet 3.0 in web.xml <filter> <filter-name>loggingfilter</filter-name> <filter-class>example.loggingfilter</filter-class> </filter> <filter-mapping> <filter-name>hello</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> Filter declaration Life cycle event listeners In Servlet 3.0 via public class LoggingFilter implements Filter {... javax.servlet.servletcontextlistener javax.servlet.servletcontextattributelistener javax.servlet.servletrequestlistener javax.servlet.servletrequestattributelistener javax.servlet.http.httpsessionlistener javax.servlet.http.httpsessionattributelistener Listener example Listener declaration public class LoggingRequestListener implements ServletRequestListener public void requestinitialized(servletrequestevent event) { System.out.println("Received request from " + public void requestdestroyed(servletrequestevent event) { Before Servlet 3.0 in web.xml <listener> <listener-class> example.loggingrequestlistener </listener-class> </listener> 15
16 Listener declaration Should I bother? In Servlet 3.0 via public class LoggingRequestListener implements ServletRequestListener {... There are a lot of fancy Java web frameworks that simplify application building. Should I still learn these basic technologies, will I ever use them? Should I bother? Should I bother? You are still going to deploy your application to a web container. Most traditional frameworks use JSP as the view technology. What about servlets? Sources of wisdom Most frameworks are based on the Servlet API You will probably still encounter things like HttpSession, HttpServletRequest etc inside your code. You might want to write filters and listeners. You probably won t write much servlets. But sometimes they can still be handy for simple tasks. AngularJS and REST (Representational State Transfer) Tutorial API 16
Java Technologies. Lecture X. Valdas Rapševičius. Vilnius University Faculty of Mathematics and Informatics 2012.12.31
Preparation of the material was supported by the project Increasing Internationality in Study Programs of the Department of Computer Science II, project number VP1 2.2 ŠMM-07-K-02-070, funded by The European
More informationManaging Data on the World Wide-Web
Managing Data on the World Wide-Web Sessions, Listeners, Filters, Shopping Cart Elad Kravi 1 Web Applications In the Java EE platform, web components provide the dynamic extension capabilities for a web
More informationJava EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java
Java EE Introduction, Content Component Architecture: Why and How Java EE: Enterprise Java The Three-Tier Model The three -tier architecture allows to maintain state information, to improve performance,
More informationPure server-side Web Applications with Java, JSP. Application Servers: the Essential Tool of Server-Side Programming. Install and Check Tomcat
Pure server-side Web Applications with Java, JSP Discussion of networklevel http requests and responses Using the Java programming language (Java servlets and JSPs) Key lesson: The role of application
More informationClass Focus: Web Applications that provide Dynamic Content
Class Focus: Web Applications that provide Dynamic Content We will learn how to build server-side applications that interact with their users and provide dynamic content Using the Java programming language
More information2.8. Session management
2.8. Session management Juan M. Gimeno, Josep M. Ribó January, 2008 Session management. Contents Motivation Hidden fields URL rewriting Cookies Session management with the Servlet/JSP API Examples Scopes
More informationWeb Container Components Servlet JSP Tag Libraries
Web Application Development, Best Practices by Jeff Zhuk, JavaSchool.com ITS, Inc. dean@javaschool.com Web Container Components Servlet JSP Tag Libraries Servlet Standard Java class to handle an HTTP request
More informationPrinciples and Techniques of DBMS 5 Servlet
Principles and Techniques of DBMS 5 Servlet Haopeng Chen REliable, INtelligentand Scalable Systems Group (REINS) Shanghai Jiao Tong University Shanghai, China http://reins.se.sjtu.edu.cn/~chenhp e- mail:
More informationPA165 - Lab session - Web Presentation Layer
PA165 - Lab session - Web Presentation Layer Author: Martin Kuba Goal Experiment with basic building blocks of Java server side web technology servlets, filters, context listeners,
More informationJava Servlet Tutorial. Java Servlet Tutorial
Java Servlet Tutorial i Java Servlet Tutorial Java Servlet Tutorial ii Contents 1 Introduction 1 1.1 Servlet Process.................................................... 1 1.2 Merits.........................................................
More informationJSP. Common patterns
JSP Common patterns Common JSP patterns Page-centric (client-server) CLIENT JSP or Servlet CLIENT Enterprise JavaBeans SERVER DB Common JSP patterns Page-centric 1 (client-server) Page View request response
More informationComplete Java Web Development
Complete Java Web Development JAVA-WD Rev 11.14 4 days Description Complete Java Web Development is a crash course in developing cutting edge Web applications using the latest Java EE 6 technologies from
More informationIntroduction to J2EE Web Technologies
Introduction to J2EE Web Technologies Kyle Brown Senior Technical Staff Member IBM WebSphere Services RTP, NC brownkyl@us.ibm.com Overview What is J2EE? What are Servlets? What are JSP's? How do you use
More informationCh-03 Web Applications
Ch-03 Web Applications 1. What is ServletContext? a. ServletContext is an interface that defines a set of methods that helps us to communicate with the servlet container. There is one context per "web
More informationArjun V. Bala Page 20
12) Explain Servlet life cycle & importance of context object. (May-13,Jan-13,Jun-12,Nov-11) Servlet Life Cycle: Servlets follow a three-phase life cycle, namely initialization, service, and destruction.
More informationWeb Programming: Announcements. Sara Sprenkle August 3, 2006. August 3, 2006. Assignment 6 due today Project 2 due next Wednesday Review XML
Web Programming: Java Servlets and JSPs Sara Sprenkle Announcements Assignment 6 due today Project 2 due next Wednesday Review XML Sara Sprenkle - CISC370 2 1 Web Programming Client Network Server Web
More informationHow To Understand The Architecture Of Java 2Ee, J2Ee, And J2E (Java) In A Wordpress Blog Post
Understanding Architecture and Framework of J2EE using Web Application Devadrita Dey Sarkar,Anavi jaiswal, Ankur Saxena Amity University,UTTAR PRADESH Sector-125, Noida, UP-201303, India Abstract: This
More informationBuilding Web Applications, Servlets, JSP and JDBC
Building Web Applications, Servlets, JSP and JDBC Overview Java 2 Enterprise Edition (JEE) is a powerful platform for building web applications. The JEE platform offers all the advantages of developing
More informationACM Crossroads Student Magazine The ACM's First Electronic Publication
Page 1 of 8 ACM Crossroads Student Magazine The ACM's First Electronic Publication Crossroads Home Join the ACM! Search Crossroads crossroads@acm.org ACM / Crossroads / Columns / Connector / An Introduction
More informationServlet 3.0. Alexis Moussine-Pouchkine. mercredi 13 avril 2011
Servlet 3.0 Alexis Moussine-Pouchkine 1 Overview Java Servlet 3.0 API JSR 315 20 members Good mix of representation from major Java EE vendors, web container developers and web framework authors 2 Overview
More informationWeb Application Programmer's Guide
Web Application Programmer's Guide JOnAS Team ( Florent BENOIT) - March 2009 - Copyright OW2 consortium 2008-2009 This work is licensed under the Creative Commons Attribution-ShareAlike License. To view
More informationWeb Applications. For live Java training, please see training courses at
2009 Marty Hall Using and Deploying Web Applications Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
More informationDeveloping an EJB3 Application. on WebSphere 6.1. using RAD 7.5
Developing an EJB3 Application on WebSphere 6.1 using RAD 7.5 Introduction This tutorial introduces how to create a simple EJB 3 application using Rational Application Developver 7.5( RAD7.5 for short
More informationConfigure a SOAScheduler for a composite in SOA Suite 11g. By Robert Baumgartner, Senior Solution Architect ORACLE
Configure a SOAScheduler for a composite in SOA Suite 11g By Robert Baumgartner, Senior Solution Architect ORACLE November 2010 Scheduler for the Oracle SOA Suite 11g: SOAScheduler Page 1 Prerequisite
More informationCreating Java EE Applications and Servlets with IntelliJ IDEA
Creating Java EE Applications and Servlets with IntelliJ IDEA In this tutorial you will: 1. Create IntelliJ IDEA project for Java EE application 2. Create Servlet 3. Deploy the application to JBoss server
More informationJava Servlet 3.0. Rajiv Mordani Spec Lead
Java Servlet 3.0 Rajiv Mordani Spec Lead 1 Overview JCP Java Servlet 3.0 API JSR 315 20 members > Good mix of representation from major Java EE vendors, web container developers and web framework authors
More informationDevelopment of Web Applications
Development of Web Applications Principles and Practice Vincent Simonet, 2013-2014 Université Pierre et Marie Curie, Master Informatique, Spécialité STL 3 Server Technologies Vincent Simonet, 2013-2014
More informationServlet and JSP Filters
2009 Marty Hall Servlet and JSP Filters Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
More informationGlassfish, JAVA EE, Servlets, JSP, EJB
Glassfish, JAVA EE, Servlets, JSP, EJB Java platform A Java platform comprises the JVM together with supporting class libraries. Java 2 Standard Edition (J2SE) (1999) provides core libraries for data structures,
More informationControlling Web Application Behavior
2006 Marty Hall Controlling Web Application Behavior The Deployment Descriptor: web.xml JSP, Servlet, Struts, JSF, AJAX, & Java 5 Training: http://courses.coreservlets.com J2EE Books from Sun Press: http://www.coreservlets.com
More informationCourse Name: Course in JSP Course Code: P5
Course Name: Course in JSP Course Code: P5 Address: Sh No BSH 1,2,3 Almedia residency, Xetia Waddo Duler Mapusa Goa E-mail Id: ITKP@3i-infotech.com Tel: (0832) 2465556 (0832) 6454066 Course Code: P5 3i
More informationServlets. Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun
Servlets Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun 1 What is a Servlet? A Servlet is a Java program that extends the capabilities of servers. Inherently multi-threaded.
More informationExam Prep. Sun Certified Web Component Developer (SCWCD) for J2EE Platform
Exam Prep Sun Certified Web Component Developer (SCWCD) for J2EE Platform Core Servlets & JSP book: www.coreservlets.com More Servlets & JSP book: www.moreservlets.com Servlet and JSP Training Courses:
More informationUsability. Usability
Objectives Review Usability Web Application Characteristics Review Servlets Deployment Sessions, Cookies Usability Trunk Test Harder than you probably thought Your answers didn t always agree Important
More informationPiotr Nowicki's Homepage. Java EE 6 SCWCD Mock Exam. "Simplicity is the ultimate sophistication." Important!
Piotr Nowicki's Homepage "Simplicity is the ultimate sophistication." Java EE 6 SCWCD Mock Exam Posted on March 27, 2011 by Piotr 47 Replies Edit This test might help to test your knowledge before taking
More informationAnnouncements. Comments on project proposals will go out by email in next couple of days...
Announcements Comments on project proposals will go out by email in next couple of days... 3-Tier Using TP Monitor client application TP monitor interface (API, presentation, authentication) transaction
More informationOutline. Lecture 9: Java Servlet and JSP. Servlet API. HTTP Servlet Basics
Lecture 9: Java Servlet and JSP Wendy Liu CSC309F Fall 2007 Outline HTTP Servlet Basics Servlet Lifecycle Request and Response Session Management JavaServer Pages (JSP) 1 2 HTTP Servlet Basics Current
More information15-415 Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System
15-415 Database Applications Recitation 10 Project 3: CMUQFlix CMUQ s Movies Recommendation System Project Objective 1. Set up a front-end website with PostgreSQL back-end 2. Allow users to login, like
More informationJava Web Programming. Student Workbook
Student Workbook Java Web Programming Mike Naseef, Jamie Romero, and Rick Sussenbach Published by ITCourseware, LLC., 7245 South Havana Street, Suite 100, Centennial, CO 80112 Editors: Danielle Hopkins
More informationWeb Development in Java Live Demonstrations (Live demonstrations done using Eclipse for Java EE 4.3 and WildFly 8)
Web Development in Java Live Demonstrations (Live demonstrations done using Eclipse for Java EE 4.3 and WildFly 8) Java Servlets: 1. Switch to the Java EE Perspective (if not there already); 2. File >
More informationINTRODUCTION TO WEB TECHNOLOGY
UNIT-I Introduction to Web Technologies: Introduction to web servers like Apache1.1, IIS, XAMPP (Bundle Server), WAMP Server(Bundle Server), handling HTTP Request and Response, installation of above servers
More informationListeners se es. Filters and wrappers. Request dispatchers. Advanced Servlets and JSP
Advanced Servlets and JSP Listeners se es Advanced Servlets Features Filters and wrappers Request dispatchers Security 2 Listeners also called observers or event handlers ServletContextListener Web application
More informationDevelopment. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga
Web Development with NetBeans 5.0 Quick Start in Basic Web and Struts pplications Geertjan Wielenga Web Development with NetBeans 5 This tutorial takes you through the basics of using NetBeans IDE 5.0
More informationJava 2 Web Developer Certification Study Guide Natalie Levi
SYBEX Index Java 2 Web Developer Certification Study Guide Natalie Levi Index Copyright 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved. No part of this publication
More informationSSC - Web development Model-View-Controller for Java web application development
SSC - Web development Model-View-Controller for Java web application development Shan He School for Computational Science University of Birmingham Module 06-19321: SSC Outline Outline of Topics Java Server
More informationAgenda. Summary of Previous Session. Application Servers G22.3033-011. Session 3 - Main Theme Page-Based Application Servers (Part II)
Application Servers G22.3033-011 Session 3 - Main Theme Page-Based Application Servers (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical
More informationSSC - Web applications and development Introduction and Java Servlet (II)
SSC - Web applications and development Introduction and Java Servlet (II) Shan He School for Computational Science University of Birmingham Module 06-19321: SSC Outline Outline of Topics Servlet Configuration
More information2. Follow the installation directions and install the server on ccc
Installing a Web Server 1. Install a sample web server, which supports Servlets/JSPs. A light weight web server is Apache Tomcat server. You can get the server from http://tomcat.apache.org/ 2. Follow
More informationCHAPTER 9: SERVLET AND JSP FILTERS
Taken from More Servlets and JavaServer Pages by Marty Hall. Published by Prentice Hall PTR. For personal use only; do not redistribute. For a complete online version of the book, please see http://pdf.moreservlets.com/.
More informationJava Enterprise Edition The Web Tier
Java Enterprise Edition The Web Tier Malik SAHEB Objectives of this Course Focus on Presentation The Presentation Tier as a Web application Managed by the Web Container as a Web Application Web applications
More informationCSc31800: Internet Programming, CS-CCNY, Spring 2004 Jinzhong Niu May 9, 2004. Java Servlets
CSc31800: Internet Programming, CS-CCNY, Spring 2004 Jinzhong Niu May 9, 2004 Java Servlets I have presented a Java servlet example before to give you a sense of what a servlet looks like. From the example,
More informationMastering Tomcat Development
hep/ Mastering Tomcat Development Ian McFarland Peter Harrison '. \ Wiley Publishing, Inc. ' Part I Chapter 1 Chapter 2 Acknowledgments About the Author Introduction Tomcat Configuration and Management
More informationModel-View-Controller. and. Struts 2
Model-View-Controller and Struts 2 Problem area Mixing application logic and markup is bad practise Harder to change and maintain Error prone Harder to re-use public void doget( HttpServletRequest request,
More informationJSP Java Server Pages
JSP - Java Server Pages JSP Java Server Pages JSP - Java Server Pages Characteristics: A way to create dynamic web pages, Server side processing, Based on Java Technology, Large library base Platform independence
More informationWeb Programming with Java Servlets
Web Programming with Java Servlets Leonidas Fegaras University of Texas at Arlington Web Data Management and XML L3: Web Programming with Servlets 1 Database Connectivity with JDBC The JDBC API makes it
More informationAn introduction to web programming with Java
Chapter 1 An introduction to web programming with Java Objectives Knowledge Objectives (continued) The first page of a shopping cart application The second page of a shopping cart application Components
More informationGet Success in Passing Your Certification Exam at first attempt!
Get Success in Passing Your Certification Exam at first attempt! Exam : 1Z0-899 Title : Java EE 6 Web Component Developer Certified Expert Exam Version : Demo 1.Given the element from the web application
More informationWeb Application Architecture (based J2EE 1.4 Tutorial)
Web Application Architecture (based J2EE 1.4 Tutorial) 1 Disclaimer & Acknowledgments Even though Sang Shin is a full-time employee of Sun Microsystems, the contents here are created as his own personal
More informationDTS Web Developers Guide
Apelon, Inc. Suite 202, 100 Danbury Road Ridgefield, CT 06877 Phone: (203) 431-2530 Fax: (203) 431-2523 www.apelon.com Apelon Distributed Terminology System (DTS) DTS Web Developers Guide Table of Contents
More informationCONTROLLING WEB APPLICATION BEHAVIOR WITH
CONTROLLING WEB APPLICATION BEHAVIOR WITH WEB.XML Chapter Topics in This Chapter Customizing URLs Turning off default URLs Initializing servlets and JSP pages Preloading servlets and JSP pages Declaring
More informationIn this chapter the concept of Servlets, not the entire Servlet specification, is
falkner.ch2.qxd 8/21/03 4:57 PM Page 31 Chapter 2 Java Servlets In this chapter the concept of Servlets, not the entire Servlet specification, is explained; consider this an introduction to the Servlet
More informationAspects of using Hibernate with CaptainCasa Enterprise Client
Aspects of using Hibernate with CaptainCasa Enterprise Client We all know: there are a lot of frameworks that deal with persistence in the Java environment one of them being Hibernate. And there are a
More information11.1 Web Server Operation
11.1 Web Server Operation - Client-server systems - When two computers are connected, either could be the client - The client initiates the communication, which the server accepts - Generally, clients
More informationJava Server Pages Tutorial
Java Server Pages Tutorial JAVA SERVER PAGES TUTORIAL by tutorialspoint.com tutorialspoint.com ABOUT THE TUTORIAL JSP Tutorial Java Server Pages (JSP) is a server-side programming technology that enables
More informationJava 2 Web Developer Certification Study Guide Natalie Levi
SYBEX Sample Chapter Java 2 Web Developer Certification Study Guide Natalie Levi Chapter 8: Thread-Safe Servlets Copyright 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights
More informationAgilité des applications Java EE 6
Agilité des applications Java EE 6 Guillaume Sauthier, Bull, OW2 TC Chairman guillaume.sauthier@ow2.org Agenda Java EE 6 Main goals Agile? Web Profile What's inside? Benefits Java EE 6 > Main goals Ease
More informationPenetration from application down to OS
April 8, 2009 Penetration from application down to OS Getting OS access using IBM Websphere Application Server vulnerabilities Digitаl Security Research Group (DSecRG) Stanislav Svistunovich research@dsecrg.com
More informationWeb Programming II JSP (Java Server Pages) ASP request processing. The Problem. The Problem. Enterprise Application Development using J2EE
Enterprise Application Development using J2EE Shmulik London Lecture #6 Web Programming II JSP (Java Server Pages) How we approached it in the old days (ASP) Multiplication Table Multiplication
More informationCOMP9321 Web Applications Engineering: Java Servlets
COMP9321 Web Applications Engineering: Java s Service Oriented Computing Group, CSE, UNSW Week 2 H. Paik (CSE, UNSW) COMP9321, 13s2 Week 2 1 / 1 Different Layers in an Application Different solutions for
More informationWebSphere and Message Driven Beans
WebSphere and Message Driven Beans 1 Messaging Messaging is a method of communication between software components or among applications. A messaging system is a peer-to-peer facility: A messaging client
More informationIntroduction to Web Technologies
Secure Web Development Teaching Modules 1 Introduction to Web Technologies Contents 1 Concepts... 1 1.1 Web Architecture... 2 1.2 Uniform Resource Locators (URL)... 3 1.3 HTML Basics... 4 1.4 HTTP Protocol...
More informationIn this chapter, we lay the foundation for all our further discussions. We start
01 Struts.qxd 7/30/02 10:23 PM Page 1 CHAPTER 1 Introducing the Jakarta Struts Project and Its Supporting Components In this chapter, we lay the foundation for all our further discussions. We start by
More informationchapter 3Chapter 3 Advanced Servlet Techniques Servlets and Web Sessions Store Information in a Session In This Chapter
chapter 3Chapter 3 Advanced Servlet Techniques In This Chapter Using sessions and storing state Using cookies for long-term storage Filtering HTTP requests Understanding WebLogic Server deployment issues
More informationUniversità degli Studi di Napoli Federico II. Corsi di Laurea Specialistica in Ingegneria Informatica ed Ingegneria delle Telecomunicazioni
Università degli Studi di Napoli Federico II Corsi di Laurea Specialistica in Ingegneria Informatica ed Ingegneria delle Telecomunicazioni Corso di Applicazioni Telematiche Prof. spromano@unina.it 1 Some
More informationManual. Programmer's Guide for Java API
2013-02-01 1 (15) Programmer's Guide for Java API Description This document describes how to develop Content Gateway services with Java API. TS1209243890 1.0 Company information TeliaSonera Finland Oyj
More informationWeb Frameworks and WebWork
Web Frameworks and WebWork Problem area Mixing application logic and markup is bad practise Harder to change and maintain Error prone Harder to re-use public void doget( HttpServletRequest request, HttpServletResponse
More informationAnders Møller & Michael I. Schwartzbach 2006 Addison-Wesley
Programming Web Applications with Servlets Anders Møller & Michael I. Schwartzbach 2006 Addison-Wesley Objectives How to program Web applications using servlets Advanced concepts, such as listeners, filters,
More informationOutline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline
Outline CS 112 Introduction to Programming Web Programming: Backend (server side) Programming with Servlet, JSP q Admin and recap q Server-side web programming overview q Servlet programming q Java servlet
More informationCourse Number: IAC-SOFT-WDAD Web Design and Application Development
Course Number: IAC-SOFT-WDAD Web Design and Application Development Session 1 (10 Hours) Client Side Scripting Session 2 (10 Hours) Server Side Scripting - I Session 3 (10 hours) Database Session 4 (10
More informationVisa Checkout September 2015
Visa Checkout September 2015 TABLE OF CONTENTS 1 Introduction 1 Integration Flow 1 Visa Checkout Partner merchant API Flow 2 2 Asset placement and Usage 3 Visa Checkout Asset Placement and Usage Requirements
More informationWeb Development on the SOEN 6011 Server
Web Development on the SOEN 6011 Server Stephen Barret October 30, 2007 Introduction Systems structured around Fowler s patterns of Enterprise Application Architecture (EAA) require a multi-tiered environment
More informationHow to use JavaMail to send email
Chapter 15 How to use JavaMail to send email Objectives Applied Knowledge How email works Sending client Mail client software Receiving client Mail client software SMTP Sending server Mail server software
More informationJava EE 6 New features in practice Part 3
Java EE 6 New features in practice Part 3 Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. License for use and distribution
More informationCreating Custom Web Pages for cagrid Services
Creating Custom Web Pages for cagrid Services Creating Custom Web Pages for cagrid Services Contents Overview Changing the Default Behavior Subclassing the AXIS Servlet Installing and Configuring the Custom
More informationWeb Applications. Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html
2009 Marty Hall Using and Deploying Web Applications Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
More informationOracle WebLogic Server
Oracle WebLogic Server Developing Web Applications, Servlets, and JSPs for Oracle WebLogic Server 10g Release 3 (10.3) July 2008 Oracle WebLogic Server Developing Web Applications, Servlets, and JSPs for
More informationEhcache Web Cache User Guide. Version 2.9
Ehcache Web Cache User Guide Version 2.9 October 2014 This document applies to Ehcache Version 2.9 and to all subsequent releases. Specifications contained herein are subject to change and these changes
More informationThe Server.xml File. Containers APPENDIX A. The Server Container
APPENDIX A The Server.xml File In this appendix, we discuss the configuration of Tomcat containers and connectors in the server.xml configuration. This file is located in the CATALINA_HOME/conf directory
More informationWeb Applications and Struts 2
Web Applications and Struts 2 Problem area Problem area Separation of application logic and markup Easier to change and maintain Easier to re use Less error prone Access to functionality to solve routine
More informationServer-Side Web Development JSP. Today. Web Servers. Static HTML Directives. Actions Comments Tag Libraries Implicit Objects. Apache.
1 Pages () Lecture #4 2007 Pages () 2 Pages () 3 Pages () Serves resources via HTTP Can be anything that serves data via HTTP Usually a dedicated machine running web server software Can contain modules
More informationHTTP Response Splitting
The Attack HTTP Response Splitting is a protocol manipulation attack, similar to Parameter Tampering The attack is valid only for applications that use HTTP to exchange data Works just as well with HTTPS
More informationSupplement IV.E: Tutorial for Tomcat. For Introduction to Java Programming By Y. Daniel Liang
Supplement IV.E: Tutorial for Tomcat For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Obtaining and Installing Tomcat Starting and Stopping Tomcat Choosing
More informationJ2EE Web Development. Agenda. Application servers. What is J2EE? Main component types Application Scenarios J2EE APIs and Services.
J2EE Web Development Agenda Application servers What is J2EE? Main component types Application Scenarios J2EE APIs and Services Examples 1 1. Application Servers In the beginning, there was darkness and
More informationCIS 455/555: Internet and Web Systems
CIS 455/555: Internet and Web Systems Fall 2015 Assignment 1: Web and Application Server Milestone 1 due September 21, 2015, at 10:00pm EST Milestone 2 due October 6, 2015, at 10:00pm EST 1. Background
More informationDeveloping Web Applications using JavaServer Pages and Servlets
Redpaper Martin Keen Rafael Coutinho Sylvi Lippmann Salvatore Sollami Sundaragopal Venkatraman Steve Baber Henry Cui Craig Fleming Developing Web Applications using JavaServer Pages and Servlets This IBM
More informationHello World Portlet Rendered with JSP for WebSphere Portal Version 4.1
1 of 11 16.10.2002 11:41 Hello World Portlet Rendered with JSP for WebSphere Portal Version 4.1 Table of Contents Creating the directory structure Creating the Java code Compiling the code Creating the
More informationWeb. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture #3 2008 3 Apache.
JSP, and JSP, and JSP, and 1 2 Lecture #3 2008 3 JSP, and JSP, and Markup & presentation (HTML, XHTML, CSS etc) Data storage & access (JDBC, XML etc) Network & application protocols (, etc) Programming
More informationSession Tracking Customized Java EE Training: http://courses.coreservlets.com/
2012 Marty Hall Session Tracking Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 2 Customized Java EE Training: http://courses.coreservlets.com/
More informationJava EE 6 Ce qui vous attends
13 janvier 2009 Ce qui vous attends Antonio Goncalves Architecte Freelance «EJBs are dead...» Rod Johnson «Long live EJBs!» Antonio Goncalves Antonio Goncalves Software Architect Former BEA Consultant
More informationNicholas S. Williams. wrox. A Wiley Brand
Nicholas S. Williams A wrox A Wiley Brand CHAPTER 1; INTRODUCING JAVA PLATFORM, ENTERPRISE EDITION 3 A Timeline of Java Platforms 3 In the Beginning 4 The Birth of Enterprise Java 5 Java SE and Java EE
More information