Java Server Pages B.Ramamurthy. Java Server Pages Servlets are pure Java programs. They introduce dynamism into web pages by using programmatic content.

Slides:



Advertisements
Similar presentations
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
Advertisements

Java Server Pages (JSP)
Java Server Pages Jeffrey Jongko. Introduction Java Server Pages (JSP) technology was created by Sun Microsystems and is built on top of Sun’s Java Servlet.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Chapter 51 Scripting With JSP Elements JavaServer Pages By Xue Bai.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
DT228/3 Web Development JSP: Directives and Scripting elements.
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.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
UNIT-V The MVC architecture and Struts Framework.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 37 - JavaServer Pages (JSP): Bonus for Java Developers Outline 37.1 Introduction 37.2 JavaServer.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
JSP Java Server Pages Softsmith Infotech.
Introduction to JavaServer Pages (JSP) Slides from Dr. Mark Llewellyn.
Java Server Pages Lecture July Java Server Pages Java Server Pages (JSPs) provide a way to separate the generation of dynamic content (java)
Jordan Anastasiade. All rights reserved.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
 Embeds Java code  In HTML tags  When used well  Simple way to generate dynamic web-pages  When misused (complex embedded Java)  Terribly messy.
J2EE Structure & Definitions Catie Welsh CSE 432
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.
Introduction to JavaServer Pages. 2 JSP and Servlet Limitations of servlet  It’s inaccessible to non-programmers JSP is a complement to servlet  focuses.
Chapter 2 An Overview of Servlet and JSP Technology.
JSP Fundamentals Elements of a JSP Using Beans with JSP Integrating Servlets and JSP.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
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.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Java Server Pages (JSP)
Chapter 11 Invoking Java Code with JSP Scripting Elements.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
CSI 3125, Preliminaries, page 1 JSP (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.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
JAVA SERVER PAGES -by Rubeena Memon Deepti Jain Jaya Thakar Jisha Vettuventra.
 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,
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.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Java Server Pages Can web pages be created specially for each user?
JSP Java Server Pages Reference:
Scripted Page Web App Development (Java Server Pages)
Knowledge Byte In this section, you will learn about:
MSIS 655 Advanced Business Applications Programming
J2EE Application Development
Distributed System Using Java 2 Enterprise Edition (J2EE)
Java Server Pages (JSP)
Java Server Pages B.Ramamurthy.
Introduction to JSP Dept. of B.Voc Software Development and System Administration St. Joseph’s College(Autonomous) Trichy-02 By Dr. J. Ronald Martin Introduction.
Presentation transcript:

Java Server Pages B.Ramamurthy

Java Server Pages Servlets are pure Java programs. They introduce dynamism into web pages by using programmatic content. JSP technology is an extension/wrapper over the Java servlet technology. JSP are text based documents. We will focus only on JSP since it subsumes the servlet technology. Two major components of JSP: Static content: provided by HTML or XML Dynamic content: generated by JSP tags and scriplets written in Java language to encapsulate the application logic.

JSP compilation into Servlets Web Browser Web Server J2EE Web Container Java Servlets JSP translation Initial request Subseq request

More on JSP syntax and contents HTML code for user interface lay out JSP tags: declarations, actions, directives, expressions, scriplets JSP implicit objects: a request object, response object, session object, config object Javabeans: for logic that can be taken care of at the JSP level. We will examine only JSP tags here.

JSP Tags Declaration: variable declaration Directive: ex: import classes Scriplet: Java code <% if password(“xyz”) { %> Welcome Expression: regular expression using variables and constants Action: <jsp:usebean name =“cart” class=“com.sun.java.Scart”

Java Server Pages by Examples JSPs combine static markup (HTML, XML) with special dynamic scripting tags. Each JSP is translated into a servlet the first time it is invoked. Then on, the requests are serviced by the servlets. Lets understand the building blocks of a JSP, namely, directives, scripting elements, and actions through a series of examples.

How to prepare and run the examples? Simple JSPs can be typed into.jsp type files using your favorite editor. Create a directory called JSPExamples in the public_html directory of J2EE. Store the example JSPs here. Start the J2EE server. Run the JSP from your browser using the command: For complex examples with actions and beans you will have to create web component (WAR).

Examples: Directives A directive configures the code generation that container will perform in creating a servlet. Simple JSP showing access to a Java API class Date: simple.jsp Using Page directives to define various page attributes: pageDirective.jsp Directive to include other JSPs: includeDirective1.jsp, includeDirective2.jsp

Examples: Scripting Elements Declaration: A declaration is a block of code in a JSP that is used to define class-wide variables and methods in the generated servlet. Declaring a piece of code: declaration.jsp

Examples: Scripting Elements (contd.) Scriplets: A scriplet is a block of Java code that is executed during the request-processing time. See scriplet.jsp Expressions: sends a value of a Java expression back to the client. See expression.jsp

Examples: Standard Actions Standard actions are well known tags that affect the run time behavior of the JSP and the response sent back to the client. Some commonly used tag actions types are:

Example: JSP Action and Using beans (not EJB) Create beans.html files that displays to the user a choice of programming languages to choose from. Store it public_html/JSPExamples/beans.html Create the file beans.jsp that deals with the request that has two parameters name of the user and the language. Store it in public_html/JSPExamples/beans.jsp Create the beans file that is a java bean with just set and get properties: call it LanguageBean.java. Store it in public_html/JSPExamples/src/com/wrox/beans/Langu ageBeans.java Compile this using javac command. javac LangaugeBeans.java Create the web application and run it as a web application.