• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Server Side Includes.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I m refering Java Servlet Prog. book of Oreilly , in 2nd chapter there is a example of server side include, it is said to create one .shtml file like this.
---
<html>
<head>
<title>times!</title>
</head>
<body>

the current time here is : <SERVLET CODE=CurrentTime>
If YOU See this SSI is not supported...</servlet>
<P>
The Current Time in LONDON is :
<servlet code=CurrentTime><Param name=zone value=GMT>
If YOU See this SSI is not supported...</servlet>
<P>
The Current Time in NEWYORK is :
<servlet code=CurrentTime><Param name=zone value=EST>
If YOU See this SSI is not supported...</servlet>
<P>
</body>
</html>
----
and a CurrentTime.java file like this:
-----
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class CurrentTime extends HttpServlet{
public void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
PrintWriter out = res.getWriter();
Date date = new Date();
DateFormat df = DateFormat.getInstance();
String zone = req.getParameter("zone");
if(zone != null){
TimeZone tz= TimeZone.getTimeZone(zone);
df.setTimeZone(tz);
}
out.println(df.format(date));
out.println("THIS IS THE TIME");
}
}
-----
according to book if i give http://localhost:8080/ssi.shtml
then i will be able to see all three times , but it doesn't work for me, I m using resin1.2.2 webserver but the comment that ssi not supported is displayed..
Please anyone if knowing help me to run the ssi.shtml file..
Thanx in advance
dhaval patel.
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic