In Class Assg 2 - solution

Slides:



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

 2002 Prentice Hall. All rights reserved. Chapter 9: Servlets Outline 9.1 Introduction 9.2 Servlet Overview and Architecture Interface Servlet and.
COMP 321 Week 8. Overview MVC Example Servlet Lifecycle Servlet Mechanics MVC Lab 5-2 Solution Lab 8-1 Introduction.
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.
Introduction to Servlets Based on: Hall, Brown, Core Servlets and JavaServer Pages.
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.
Servlets and JDBC. Servlets A form The HTML source Chapter 1 Please enter your name and password then press start Name: Password:
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
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.
Servlets. A form The HTML source Chapter 1 Please enter your name and password then press start Name: Password:
Servlets Life Cycle. The Servlet Life Cycle A servlet life cycle can be defined as the entire process from its creation till the destruction. The following.
Servlets. Our Project 3-tier application Develop our own multi-threaded server Socket level communication.
A Servlet’s Job Read explicit data sent by client (form data) Read implicit data sent by client (request headers) Generate the results Send the explicit.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Chapter 91© copyright Janson Industries 2011 Java Design Concepts ■ JSP’s ■ MVC MVC ■ Beans Beans ■ JSP Tags JSP Tags.
Session Beans Overview EJB container Remote Invocation Represent client's access to app Local / Remote speed / flexibility trade-off when to choose local.
Chapter 111© copyright Janson Industries 2011 Custom Tags ▮ Tag Handlers ▮ XML ▮ Tag Libraries ▮ Web Deployment Descriptor.
Servlets. - Java technology for Common Gateway Interface (CGI) programming. - It is a Java class that dynamically extends the function of a web server.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
Li Tak Sing COMPS311F. Static attributes in Servlets Since Servlets are also Java classes, you can also use static attributes to store values that can.
111 Java Servlets Dynamic Web Pages (Program Files) Servlets versus Java Server Pages Implementing Servlets Example: F15 Warranty Registration Tomcat Configuration.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
CGS – 4854 Summer 2012 Web Site Construction and Management Instructor: Francisco R. Ortega Chapter 2.
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.
Java Servlets. Servlets When we run small Java programs within a browser these are referred to as Applets... And when we run small Java programs within.
Mark Dixon 1 09 – Java Servlets. Mark Dixon 2 Session Aims & Objectives Aims –To cover a range of web-application design techniques Objectives, by end.
The Simplest Possible Tool - Iteration 1 Vancouver Bootcamp Mike Osterman
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
이경화 Ch13. 웹 프로그래밍 설계 및 실습 MVC2 Member.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
S ERVLETS Hits Counter 21-Nov-15. S ERVLETS - H ITS C OUNTER Many times you would be interested in knowing total number of hits on a particular page of.
Top right corner for field-mark, customer or partner logotypes. See Best practice for example. Slide title 40 pt Slide subtitle 24 pt Text 24 pt Bullets.
Hints for Assignment #8. Initial Screen Hints for the initial page You need a DOCTYPE with the proper namespaces defined You need to import the facebook.
CSE 403 The Mythical Servlet Goals Introduce basic servlet terminology Formally introduce homework 2 Walkthrough of build & deployment Group discussion.
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.
Mark Dixon 1 11 – Java Servlets. Mark Dixon 2 Session Aims & Objectives Aims –To cover a range of web-application design techniques Objectives, by end.
Configuration Web Server Tomcat - Install JDK Install Tom cat Configure Tom cat for running Servlet C:\Program Files\Apache Software Foundation\Tomcat.
©SoftMoore ConsultingSlide 1 Overview of Servlets and JavaServer Pages (JSP)
Java and the Web CSE 3330 Southern Methodist University.
Java Servlets and Java Server Pages
Java Web Applications. WAR Web Archive Introduced with servlet 2.2 specification Portable deployment mechanism for web applications Defines directory.
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.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
J2EE/Java EE Apache Tomcat v9 IBM Websphere v8 Redhat JBoss EAP v6 Oracle Weblogic v12 Fusion Web Tier ServletsJSPJSF Business Tier JMXJMSEJB.
OOSD Using Java CBTS Framework. 11/2/04CBTS2 Servlet  A servlet is a Java program that can extends Web server’s functionality.  Servlets interact with.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
Web Programming: Loop Xiaozhong Liu
Struct-like structure. Controller extends HttpServlet //Process the HTTP Get request public void doGet(HttpServletRequest request, HttpServletResponse.
Principles of Software Development
Servlet Fudamentals.
Servlets Hits Counter 20-Jul-18.
HTTP Servlet Overview Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might.
SERVLETS AND JDBC.
In Class Assg 4 - Solution
In Class Assg 3 - Solution
Generating the Server Response: HTTP Status Codes
Servlets and JSP 20-Nov-18 servletsJSP.ppt.
Servlets & JSP.
© copyright Janson Industries 2011
© copyright Janson Industries 2011
© 2014, Mike Murach & Associates, Inc.
Introduction to Java Servlets
Basic servlet structure
JSP In Class Assg 1 Do same thing using JSP tags instead of scripting tags Chapter 9 © copyright Janson Industries 2011.
Presentation transcript:

In Class Assg 2 - solution Create a servlet called FuncServlet that is Called by Functions2.html Based on the selected function, redirects to either Cust.html or Sale.html Functions .html FuncServlet User Cust or Sale.html Don’t forget to change Functions2.html to invoke FuncServlet Chapter 8 © copyright Janson Industries 2011

© copyright Janson Industries 2011 import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class FuncServlet extends HttpServlet { private static final long serialVersionUID = 1L; public FuncServlet() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String FuncDD = request.getParameter("FuncDD"); if (FuncDD.equals("Customer")) { response.sendRedirect("Cust.html"); } else { response.sendRedirect("Sale.html"); protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Chapter 8 © copyright Janson Industries 2011