Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 10 Overview of JSP Technology. Understanding the need for JSP JSP technology enables to mix regular, static HTML with dynamically generated content.

Similar presentations


Presentation on theme: "Chapter 10 Overview of JSP Technology. Understanding the need for JSP JSP technology enables to mix regular, static HTML with dynamically generated content."— Presentation transcript:

1 Chapter 10 Overview of JSP Technology

2 Understanding the need for JSP JSP technology enables to mix regular, static HTML with dynamically generated content. Simply write the regular HTML in the normal manner, using familiar Web-page-building tools. Then enclose the code for the dynamic parts in special tags, most of which start with. Example: Listing 10.1

3 Understanding the need for JSP Servlets as Java code with HTML inside JSP as HTML with Java code inside JSP pages and servlets, they are the same thing. JSP pages are translated into servlets, the servlets are compiled. At request time it is the compiled servlets that execute

4 Understanding the need for JSP Writing JSP pages is really just another way of writing servlets Even though servlets and JSP pages are equivalent behind the scenes, they are not equally useful in all situations

5 The Need for JSP Servlets have the following deficiencies when it comes to generating the output It is hard to write and maintain the HTML You cannot use standard HTML tools The HTML is inaccessible to non-Java developers

6 Benefits of JSP It is easier to write and maintain the HTML You can use standard Web-site development tools You can divide up your development team

7 Installation of JSP Pages Servlets require you to set your CLASSPATH Not so with JSP pages JSP pages can be placed in the same directories as normal HTML pages, images, and style sheets JSP Directories for Tomcat (Default Web Application) install_dir/webapps/ROOT

8 Basic Syntax JSP Comment JSP Expression JSP Scriptlet JSP Declaration

9 Practice Exercise Write program to calculate Internet Service Fee.

10 Normal Customer: Discount 0% Special Customer: Discount 10% The Internet Service Open from 6 AM to 22 PM Before 16PM charge per hour is 2000 VND. After 16 PM charge per hour is 3000. If customer use internet greater than 5 hours, he will receive discount 5%


Download ppt "Chapter 10 Overview of JSP Technology. Understanding the need for JSP JSP technology enables to mix regular, static HTML with dynamically generated content."

Similar presentations


Ads by Google