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.