SlideShare a Scribd company logo
URI HANDLERS
1
- SERVER-SIDE TECHNOLOGIES
By : Sayalee Pote
What is a URI?
2
U - Uniform
R - Resource
I - Identifier
“A URI is a string of characters used to identify a name of
a web resource.”
Example:
http://en.wikipedia.org/wiki/Web_engineering
Relationship between URI, URL and URN.
 Uniform Resource Name (URN)
 Uniform Resource Locator (URL)
URL: file:///home/username/books/RomeoAndJuliet.pdf
URN:isbn:0-486-27557-4
3
URI Handlers
4
ACCEPT REQUEST EXECUTION RETURN RESULT
Various URI handlers:
Server-Side Includes (SSI)
CGI/FastCGI
Server-side Scripting
Servlets
Java Server Pages (JSP)
ASP.NET
5
Server-Side Includes (SSI)
 Directives that are placed in HTML pages.
 Evaluated on the server while the pages are being served.
 They let you add dynamically generated content to an existing HTML
page.
 Special file extension : shtml
 Syntax:
<!--#element attribute=value attribute=value ... -->
 Example:
<!--#echo var="DATE_LOCAL" -->
6
SSI supports the following commands:
include
<!--#include virtual="/cgi-bin/counter.pl" -->
//outputs the results of a CGI program
exec
<!--#exec cmd="dir" -->
//gives you a directory listing
7
CGI/FastCGI
8
 CGI stands for Common Gateway Interface.
 Standardized interface between Web servers and application
programs.
 Use of Form tags of HTML.
READ PARAMETERS PROCESS THEM CREATE AN
OUTPUT AS HTML DOCUMENT
Server-side scripting
 Introduces Active Server Pages (ASP)
 All URI handlers mentioned here define a script language.
 Executed by a script interpreter.
 HTML files saved with an extension .asp
 Not limited to one single scripting language.
9
Servlets
 Enhancement of CGI technology in Java
 Invoked by special URLs to process incoming requests.
 Multi-Threading capabilities.
 Offer session tracking.
10
JSP
 Dynamically generated web pages
 Released by Sun microsystems
 Similar to PHP
 Deployment of JSP
11
WHY USE JSP??
vs ASP
vs Pure Servlets
vs JavaScript
vs Static HTML
12
JSP MODEL
13
SAMPLE CODE
 <!DOCTYPE html>
 <html>
 <body>
 <p>Click the button to get a time-based greeting.</p>
 <button onclick="myFunction()">Try it</button>
 <p id="demo"></p>
 <script>
 function myFunction()
 {var x="";
 var time=new Date().getHours();
 if (time<20)
 {x="Good day";
 }
 else
 {x="Good evening";
 }
 document.getElementById("demo").innerHTML=x;
 }
 </script>
 </body>
 </html>
14
OUTPUT
15
ASP.NET
 Static web pages
 Next generation of ASPs.
 ASP.NET is a valuable tool for programmers
 Use of .NET languages is allowed besides script languages
 Visual Studio
 Server side
 Eg: Amazon.com,eBay.com
16
OVERVIEW
Object Oriented Programming
Page gets compiled into an intermediate
language
Intermediate code is converted to machine code
Machine code is eventually run on the processor
17
18
THANK YOU!

More Related Content

URI handlers

  • 1. URI HANDLERS 1 - SERVER-SIDE TECHNOLOGIES By : Sayalee Pote
  • 2. What is a URI? 2 U - Uniform R - Resource I - Identifier “A URI is a string of characters used to identify a name of a web resource.” Example: http://en.wikipedia.org/wiki/Web_engineering
  • 3. Relationship between URI, URL and URN.  Uniform Resource Name (URN)  Uniform Resource Locator (URL) URL: file:///home/username/books/RomeoAndJuliet.pdf URN:isbn:0-486-27557-4 3
  • 4. URI Handlers 4 ACCEPT REQUEST EXECUTION RETURN RESULT
  • 5. Various URI handlers: Server-Side Includes (SSI) CGI/FastCGI Server-side Scripting Servlets Java Server Pages (JSP) ASP.NET 5
  • 6. Server-Side Includes (SSI)  Directives that are placed in HTML pages.  Evaluated on the server while the pages are being served.  They let you add dynamically generated content to an existing HTML page.  Special file extension : shtml  Syntax: <!--#element attribute=value attribute=value ... -->  Example: <!--#echo var="DATE_LOCAL" --> 6
  • 7. SSI supports the following commands: include <!--#include virtual="/cgi-bin/counter.pl" --> //outputs the results of a CGI program exec <!--#exec cmd="dir" --> //gives you a directory listing 7
  • 8. CGI/FastCGI 8  CGI stands for Common Gateway Interface.  Standardized interface between Web servers and application programs.  Use of Form tags of HTML. READ PARAMETERS PROCESS THEM CREATE AN OUTPUT AS HTML DOCUMENT
  • 9. Server-side scripting  Introduces Active Server Pages (ASP)  All URI handlers mentioned here define a script language.  Executed by a script interpreter.  HTML files saved with an extension .asp  Not limited to one single scripting language. 9
  • 10. Servlets  Enhancement of CGI technology in Java  Invoked by special URLs to process incoming requests.  Multi-Threading capabilities.  Offer session tracking. 10
  • 11. JSP  Dynamically generated web pages  Released by Sun microsystems  Similar to PHP  Deployment of JSP 11
  • 12. WHY USE JSP?? vs ASP vs Pure Servlets vs JavaScript vs Static HTML 12
  • 14. SAMPLE CODE  <!DOCTYPE html>  <html>  <body>  <p>Click the button to get a time-based greeting.</p>  <button onclick="myFunction()">Try it</button>  <p id="demo"></p>  <script>  function myFunction()  {var x="";  var time=new Date().getHours();  if (time<20)  {x="Good day";  }  else  {x="Good evening";  }  document.getElementById("demo").innerHTML=x;  }  </script>  </body>  </html> 14
  • 16. ASP.NET  Static web pages  Next generation of ASPs.  ASP.NET is a valuable tool for programmers  Use of .NET languages is allowed besides script languages  Visual Studio  Server side  Eg: Amazon.com,eBay.com 16
  • 17. OVERVIEW Object Oriented Programming Page gets compiled into an intermediate language Intermediate code is converted to machine code Machine code is eventually run on the processor 17