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.

Slides:



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

PHP I.
Introducing JavaScript
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
Introduction to JavaScript
Java Server Pages (JSP)
JSP1 Java Server Pages (JSP) Introducing JavaServer Pages TM (JSP TM ) JSP scripting elements.
 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.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
DT228/3 Web Development JSP: Directives and Scripting elements.
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,
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Three types of scripting elements: 1.Expressions 2.Scriptlets 3.Declarations Scripting elements.
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems JavaServer Pages (JSP)
JSP Architecture  JSP is a simple text file consisting of HTML or XML content along with JSP elements  JSP packages define the interface for the compiled.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
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.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
JSP Java Server Pages Softsmith Infotech.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
Introduction to Java Server Pages (JSPs) Robert Thornton.
Introduction to JavaServer Pages (JSP) Slides from Dr. Mark Llewellyn.
 Embeds Java code  In HTML tags  When used well  Simple way to generate dynamic web-pages  When misused (complex embedded Java)  Terribly messy.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
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.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Introduction to JavaServer Pages. 2 JSP and Servlet Limitations of servlet  It’s inaccessible to non-programmers JSP is a complement to servlet  focuses.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 Welcome to CSC 301 Web Programming Charles Frank.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
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)
Web App GUI: JSP Basics & Forms 3680 Enterprise Programming.
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.
Introduction to JavaScript CS101 Introduction to Computing.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
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.
21/12/20151 T h i s p r e s e n t a t i o n w i l l p r o b a b l y i n v o l v e a u d i e n c e d i s c u s s i o n, w h i c h w i l l c r e a t e a.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
STRUCTURE OF JSP PRESENTED BY: SIDDHARTHA SINGH ( ) SOMYA SHRIVASTAV ( ) SONAM JINDAL ( )
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
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.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Tutorial 10 Programming with JavaScript
Java Servlets.
Java Server Pages B.Ramamurthy.
Tutorial 10: Programming with javascript
Presentation transcript:

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 content delivered by the web server. The term dynamic describes the process of generating HTML pages according to the information requested by the user to the web server.

Client Side Scripting Scripting means the location where the code is processed. In CSS code is processed at the client side. We embed client side scripting languages code to the HTML. E.g. Javascript,Vbscript,Jscript

Advantages 1.Work on the server is reduced, since processing is done at client side. 2.Network traffic is reduced. 3.Faster than server side scripting.

Disadvantages 1.Code is completely visible to the user and hence no security to data.

Server Side Scripting Request is processed at the server side. Coder is protected. Server will have additional workload. Comparatively slow. E.g. CGI/Perl, JSP,ASP

The problem with CGI is that program must be restarted for every request. Sun Microsystems introduced servlet to solve this problem. Servlet is a small piece of code that extends the functionality of a server. Later JSP was introduced.

Phases of a JSP Each JSP goes through 2 distinct phases. 1.Translation phase/time 2.Request phase/time At translation phase JSP engine turns JSP file into a servlet. It happens whenever we modify a JSP file. At Request phase servlet is run to generate the required page. Handling of comments happens at translation phase.

JSP Processing The following steps explain how the web server creates the web page using JSP: As with a normal page, your browser sends an HTTP request to the web server. The web server recognizes that the HTTP request is for a JSP page and forwards it to a JSP engine. This is done by using the URL or JSP page which ends with.jsp instead of.html.

The JSP engine loads the JSP page from disk and converts it into a servlet content. This conversion is very simple in which all template text is converted to println( ) statements and all JSP elements are converted to Java code that implements the corresponding dynamic behavior of the page.

The JSP engine compiles the servlet into an executable class and forwards the original request to a servlet engine. A part of the web server called the servlet engine loads the Servlet class and executes it. During execution, the servlet produces an output in HTML format, which the servlet engine passes to the web server inside an HTTP response.

The web server forwards the HTTP response to your browser in terms of static HTML content. Finally web browser handles the dynamically generated HTML page inside the HTTP response exactly as if it were a static page.

In order to execute a jsp page we have 2 requirements. 1.Java should be installed. 2.Webserver should be installed. E.g. Tomcat,Weblogic,Websphere

Building blocks of JSP 1.JSP expressions 2.JSP scriplets 3.JSP declarations

JSP expression It has the following form It is used to insert java values directly into the output. Java expression is evaluated, converted to a string and inserted in the page.

A Comment Test Today's date:

Output Today's date: 05-Sep :24:25

JSP Comments JSP comment marks text or statements that the JSP container should ignore. A JSP comment is useful when you want to hide or "comment out" part of your JSP page. Following is the syntax of JSP comments:

JSP declarations It takes the form E.g. The browser will display 101. JSP declaration can contain many declarations but a JSP expression contains only one expression.

We can also declare a method in a JSP declaration and can call it from a JSP expression. <%! int count=100; int plusone(int n) { return n+1; } %> The no: you are looking is The no: is still

Scriplets It is a piece of Java code sandwiched between the characters It takes the following form:

Have a nice day! Have a dull day!

Hello World Hello World!

DeclarationScripletExpression Enclosed in ContainsOne or more java declarations or method definitions Java code(condition checking,loops etc) One java expression What it doesCreates a name possibly gives the name a value Tells the system to do something Has a value When the JSP container runs it When page is 1 st visited or the JSP container reinitializes the page Whenever someone visits the page

Request and Response Objects When we receive a request from a user, we can get information about that request by calling methods associated with the implicit request object. When you prepare a response, we can set the characteristics of the response b calling methods associated with the implicit response object.

Methods of request object are: 1.getHeader() (i)Browser your are using is (ii)Cookie information stored is (iii)Your browser is willing to accept the following MIME types

2. getMethod() (i) Method used for sending request is 3.getRemoteAddr() (i) IP address of the client machine is 4.getRemoteHost() (i) DNS name is

5. getLocale() (i)You are from (ii)You are using language.

Methods of remote object are: 1.sendRedirect() 2.sendError()

Forms and request parameters Login.htm validation Username Password

Clicking the Submit button send the following request: bc & password=xyz

authenticate.jsp <% If(request.getParameter(“pwd”).equals (“xyz”)){ %> Welcome <% } else { %>