4.4. QUASI STRINGS
51
Note that if you want to include any curly braces in your webpage you have to
put backslashes in front of them
2
.
{
Simple servlet
Like this \{ and this \}
}
A slightly more interesting servlet is one that display the current local time.
This is done by including the text
[(Date.)]
at the point in the web page where you want the current time and date to
appear.
; date.servlet    this returns a page with the date/time
{
Current Time and Date
The current local time and date is 
[(Date.)]

(This page is powered by Scheme servlets!)
}
The square braces  [  and  ]  in the date.servlet servlet tell the server that
the element they enclose is a Scheme expression that should be run to get its
value. That value is then inserted directly into the page. Returning to the
date.servlet example, if you then visit the URL
http://SERVER.DOMAIN:8080/scheme/date.servlet
you will get a web page that contains the following text:
The current local time and date is
Sun Jan 20 07:46:44 EST 2002
(This page is powered by Scheme servlets!)
Clearly, one can create a more interesting page by using CSS and more HTML
markup.
2
The backslash indicates that the following character is to be viewed as just a character.




  

Home

About Services Network Support FAQ Order Contact
 

Tomcat Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved