MC365 Application Servers: Java Server Pages (JSP’s) and Session Management.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Servlets and Java Server Pages.
Java Server Pages (JSP)
Servlets Enterprise Systems Programming. Servlets  Servlets: server-side Java programs that enable dynamic processing of web-based requests  Web-based.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Michael Brockway Application Integration JavaServer Pages l Introduction & Overview l Implicit Objects l Scripting l Standard Actions l Directives l References.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
MC365 Application Servers: Servlets. Today We Will Cover: What a servlet is The HTTPServlet and some of its more important methods How to configure the.
DT211/3 Internet Application Development JSP: Processing User input.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
Apache Tomcat Server Typical html Request/Response cycle
Java Server Pages B.Ramamurthy. Java Server Pages Servlets are pure Java programs. They introduce dynamism into web pages by using programmatic content.
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
Comp2513 Java Server Pages Daniel L. Silver, Ph.D.
Q: According to Intel, the Pentium conforms to the IEEE standards 754 and 854 for floating point arithmetic. If you fly in aircraft designed using a Pentium,
Tomcat Configuration A Very, Very, Very Brief Overview.
Julien Thibault / Phil Brewster / Kristina Doing-Harris
Java web development Servlet & Java server pages.
Java Servlets and JSP.
 What I hate about you things people often do that hurt their Web site’s chances with search engines.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
JSP and Servlets Lecture notes by Theodoros Anagnostopoulos.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
J2EE Web Fundamentals Lesson 1 Introduction and Overview
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
4/1/2003Application Server Standards Application Server Standards for ITSS Bruce Vincent, ITSS Technology Strategist.
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
JSP Java Server Pages Softsmith Infotech.
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.
111 Java Servlets Dynamic Web Pages (Program Files) Servlets versus Java Server Pages Implementing Servlets Example: F15 Warranty Registration Tomcat Configuration.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
Chapter 8 Script-free pages. Problem with scripting in JSP When you use scripting (declaration, scriplet, expressions) in your JSP, you actually put Java.
Standalone Java Application vs. Java Web Application
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
Chapter 6 Server-side Programming: Java Servlets
Chapter 2 An Overview of Servlet and JSP Technology.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
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.
MC365 Application Servers, Servlets, and Java Server Pages (JSP’s): Tomcat.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
The HTTP is a standard that all Web browsers and Web servers must speak in order for the Web portion of the Internet to work.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Chapter 11 Invoking Java Code with JSP Scripting Elements.
Java Servlets and Java Server Pages Norman White Stern School of Business.
OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Field Trip #24 Setting Up a Web Server. Apache Apache is one of the most successful open source web servers In 1995 the most popular web server was the.
Java Servlets and Java Server Pages
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Java Server Pages. 2 Servlets The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
JSP / Servlets and Beans
CS320 Web and Internet Programming Web Application and MVC Chengyu Sun California State University, Los Angeles.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
4166 Review.
Creating Novell Portal Services Gadgets: An Architectural Overview
Java Server Pages B.Ramamurthy.
Presentation transcript:

MC365 Application Servers: Java Server Pages (JSP’s) and Session Management

Today We Will Cover: What a jsp is Configuring Tomcat to use your jsp Using beans to communicate between servlets and jsp’s. Debugging jsp’s 3 main ways to manage sessions

What is a JSP? JSP stands for Java Server Page JSP’s are simply an HTML document combined with java code. –Note: The app server actually treats the jsp as a servlet and compiles the code into a class file before it executes it. This is transparent to the developer. Their purpose is to allow for dynamic web content. Servlets and JSP’s communicate and pass information back and forth using parameters.

Example of a simple JSP To see what a jsp looks like go to: Notes/basic.jsp Notes/basic.jsp

Example of a servlet calling a JSP To see an example of how a jsp is called in a servlet. Notes/ServletToJSP.java Notes/ServletToJSP.java

Configuring Tomcat to use JSP’s You can put jsp’s anywhere under the document base for your application. –Some developers like to put them in the document root directory. –Others like to keep them together under a jsp directory. Wherever you put them, you need to reference that path when you call a jsp from the servlet.

Using Beans in JSP’s Beans are often the most efficient way to pass a large number of parameters from a servlet to a jsp. –In Tomcat, when you use beans in jsp’s, they must be in a package.. Here is an example of a servlet accepting a parameter from one jsp and using a bean to pass a number of parameters to another jsp: Notes/SimpleJSPServlet.java Notes/SimpleJSPBean.java Notes/AppLogger.java Notes/input.jsp Notes/SimpleJSPServlet.java Notes/SimpleJSPBean.java Notes/AppLogger.java Notes/input.jsp Notes/simple.jsp

Debugging JSP’s So how do you debug a problem in a jsp. Because jsp’s get compiled into servlets, you can sometimes get the error HTTP Status Error 500 for a jsp. To debug a problem in a jsp: –Use loggers to write messages just like in servlets. –Another trick is to take out chunks of code and start with the basics. Test the jsp. Keep adding code back in and testing until you come across the error. At that point you will have identified where exactly the problem code lies.

3 Main Ways to Maintain Sessions using session object –you don’t want to use this too often –puts too much of a strain on server resources using cookies –you don’t want to use this too often either –users may have cookies turned off in browser passing parms in request object between a servlets and jsp’s