Java and the Web CSE 3330 Southern Methodist University.

Slides:



Advertisements
Similar presentations
Apache Tomcat as a container for Servlets and JSP
Advertisements

Java Server Pages (JSP)
Server Side Programming Common Gateway Interface (CGI): Scripts generate Web pages or other files dynamically by processing form data and returning documents.
1 CS6320 – Servlet Request Dispatcher L. Grewe 2 What is the purpose Forward a request from one servlet to another (or jsp). Forward a request from one.
Objectives Ch. D - 1 At the end of this chapter students will: Know the general architecture and purpose of servlets Understand how to create a basic servlet.
Servlets Stoney Jackson
CSE 190: Internet E-Commerce Lecture 7. HTML Templates Designed to separate server side logic from HTML presentation Key features –Escapes from HTML into.
An introduction to Java Servlet Programming
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
June 1, 2000 Object Oriented Programming in Java (95-707) Advanced Topics 1 Lecture 10 Object Oriented Programming in Java Advanced Topics Servlets.
Servlets. A form The HTML source Chapter 1 Please enter your name and password then press start Name: Password: In Netbeans you can graphically create.
2/16/2004 Dynamic Content February 16, /16/2004 Assignments Due – Message of the Day Part 1 Due – Reading and Warmup Work on Message of the Day.
1 CS6320 – Servlet Structure and Lifecycle L. Grewe.
27-Jun-15 Directories and DDs. 2 Web apps A web application is basically a web site that: “Knows who you are”--it doesn’t just give you static pages,
Introduction to Servlet & JSP
Java database Programming JDBC Trademarked name of a Java API that supports Java programs that access relational databases Stand for Java DataBase Connectivity.
1 CS6320 – Servlet Cookies L. Grewe 2 What is a cookie? Name-value bindings sent by a server to a web browser and then sent back unchanged by the browser.
Server Side Programming Web Information Systems 2012.
Definition Servlet: Servlet is a java class which extends the functionality of web server by dynamically generating web pages. Web server: It is a server.
Servlets Written by Dr. Yaron Kanza, Edited by permission from author by Liron Blecher.
Servlets Compiled by Dr. Billy B. L. Lim. Servlets Servlets are Java programs which are invoked to service client requests on a Web server. Servlets extend.
Servlets. Our Project 3-tier application Develop our own multi-threaded server Socket level communication.
Java Servlets and JSP.
Java Servlets. What Are Servlets? Basically, a java program that runs on the server Basically, a java program that runs on the server Creates dynamic.
Servlet and JSP Programming: An Introduction Spiros Papadimitriou
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Servlets Pranav Maydeo. What is a Servlet ? Servlets are modules of Java code that run in a server application to answer client requests. Servlets are.
Servlets. - Java technology for Common Gateway Interface (CGI) programming. - It is a Java class that dynamically extends the function of a web server.
Objectives Java Servlet Web Components
Functionality of a web server What does the web server do? Let a user request a resource Find the resource Return something to the user The resource can.
CSC 2720 Building Web Applications
Chapter 5 Java Servlets. Objectives Explain the nature of a servlet and its operation Use the appropriate servlet methods in a web application Code the.
Chapter 7 Java Server Pages. Objectives Explain how the separation of concerns principle applies to JSP Describe the operation and life-cycle of a JSP.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
Servlet Lifecycle Lec 28. Servlet Life Cycle  Initialize  Service  Destroy Time.
The Simplest Possible Tool - Iteration 1 Vancouver Bootcamp Mike Osterman
Java Servlets & Java Server Pages Lecture July 2013.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
A seminar on j2ee by saritha. s. What is J2EE J2EE (Java 2 Platform, Enterprise Edition) is a Java platform designed for the mainframe-scale computing.
Java Servlet API CGI / HTTP Concepts Java Servlet API.
Introduction to Server-Side Web Development Introduction to Server-Side Web Development Session II: Introduction to Server-Side Web Development with Servlets.
Servlets Part 3. Topics Session Tracking ServletToServletCommunication-Servlet Chaining ServerSideIncludes AppletToServlet.
L.MARIA MICHAEL VISUWASAM UNIT-4
CSE 403 The Mythical Servlet Goals Introduce basic servlet terminology Formally introduce homework 2 Walkthrough of build & deployment Group discussion.
Servlets.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
Introduction to Servlets Allen Day. Notes This is a training NOT a presentation Please ask questions Prerequisites.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
J2EE T ECHNOLOGIES These are the technologies required to build large scale distributed applications, can be divided into – Component Technologies eg.
©SoftMoore ConsultingSlide 1 Overview of Servlets and JavaServer Pages (JSP)
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
Introduction To HTML Dr. Magdi AMER. HTML elements.
ClaRA web services V. Gyurjyan Clas12 Software Meeting
How CGI and Java Servlets are Run By David Stein 14 November 2006.
April 20023CSG11 Electronic Commerce Java (2) John Wordsworth Department of Computer Science The University of Reading Room 129,
1 Lecture 8 George Koutsogiannakis/Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
Building Web Apps with Servlets
Servlet Fudamentals.
HTTP Servlet Overview Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might.
Java Servlets and JSP.
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Presentation transcript:

Java and the Web CSE 3330 Southern Methodist University

Standard Model of the Web Client Internet Web server Basic Request/Response Model Client makes a request for a static resource Web server responds with the static resource HTTP is the standard protocol

Generating Dynamic Content Request can contain “parameters” / “key- value” pairs of information Web server can use this data to generate dynamic content (Response) Web server isn’t just serving up static content anymore – may be taking request params and accessing a database or other service to generate content for the user.

Anatomy of a Servlet /webapps – TestServlet WEB-INF – web.xml – classes » TestServlet.java » TestServlet.class

TestServlet.java public class TestServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); /* Display some response to the user */ out.println(" "); out.println(" TestServlet "); out.println(" "); //replace YourName below with your real name. out.println(" Hello There, YourName "); out.println(" "); out.close(); }

web.xml <web-app xmlns=" xmlns:xsi=" xsi:schemaLocation=" version="2.5"> TestServlet TestServlet /TestServlet