Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.

Similar presentations


Presentation on theme: "Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001."— Presentation transcript:

1 Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001

2 JSP Definition JSP is a dynamic scripting capability for web pages that allows java as well as a few special tags to be embedded into a web file (HTML/XML, etc). The suffix traditionally ends with.Jsp to indicate to the web server that the file is a JSP file. JSP is a server side technology - can't do any client side validation with it

3 JSP

4 A JSP file is a script like an ASP file except that represents a template for a web page. When the page is first requested, the JSP is compiled into a “servlet” form and executed. Afterwards the JSP script exists as a compiled java byte-code (unless it is changed)

5 Why not just write Servlets?  The focus is on HTML. Java and the JSP extensions assist in making the HTML more functional. Servlets on the other hand allow outputting of HTML but it is a tedious process.  It is easy to make a change and then let the JSP capability of the Web Server you are using deal with compiling it into a Servlet and running it.

6 JSP

7 JSP Benefits Easy and Rapid Web Development, Deployment and Maintenance Easy and Rapid Web Development, Deployment and Maintenance Emphasizing Reusable Components Emphasizing Reusable Components Separating Content Generation from Presentation Separating Content Generation from Presentation

8 JSP Benefits Contd..... Open Development and Widespread Industry Support Open Development and Widespread Industry Support Platform Independence Platform Independence Simplifying Page Development with Tags Simplifying Page Development with Tags

9 Use of Beans One use of JavaBeans is as a data encapsulator. A property of a JavaBean is simply the data (state) of the bean. Properties are accessible by two methods: the getter and the setter. The value of the property is accessed by the getter method. If the property is writeable, its value is changed by the setter method.

10 Use of Beans contd..... Loading a Bean - Initializing a Bean - Displaying Dynamic Content -

11 Java code in your page? Three ways… Using declarations,. With scriptlets,. Expressions between.

12 A look at simple JSP code I’m HTML code.

13 Example, “Hello, World” Example: <% String name = null; if (request.getParameter(“name”) == null ) { %> Hello, World <% } else { println.out(“Hello,” + name); } %>

14 JSP Vs JavaScript JavaScript –Validates on Client Side –Less Secure –Browser Dependent –Unstable –….

15 JSP Vs. Servlets Similarities Provide identical results to the end user JSP is an additional module to the servlet

16 JSP Vs Servlets contd..... Differences Servlets: “HTML in Java Code” HTML code inaccessible to Graphics designer But accessible to Programmer JSP: “Java Code Scriplets in HTML” HTML code accessible to Graphic Designer Java code accessible to Programmer

17 JSP Vs ASP

18 Useful Links of JSP The current version of JSP is 1.1. It is available from http://java.sun.com/products/jsp.http://java.sun.com/products/jsp Archives of the JSP mailing list are available at http://archives.java.sun.com/archives/jsp-interest.html web application servers support JSP http://www.flashline.com/components/appservermatrix.jsp JSP Demo website http://www.flashline.com/

19 Conclusion JSP is robust server side dynamic web page generator. Easy to implement Easy to manage Code is portable Free

20 References Web page development using JSP by Duane K. Fields, Mark A. Kolb Java Server Pages -- by Hans Bergsten Core Servlets and JSP -- by Marty Hall Graphics used on this presentation was obtained from different web sites.

21 The End


Download ppt "Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001."

Similar presentations


Ads by Google