wood burning stoves
The moose likes Servlets and the fly likes Server Side Includes. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Server Side Includes." Watch "Server Side Includes." New topic

Server Side Includes.

Dhaval Patel

Joined: Jan 02, 2001
Posts: 7
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.

the current time here is : <SERVLET CODE=CurrentTime>
If YOU See this SSI is not supported...</servlet>
The Current Time in LONDON is :
<servlet code=CurrentTime><Param name=zone value=GMT>
If YOU See this SSI is not supported...</servlet>
The Current Time in NEWYORK is :
<servlet code=CurrentTime><Param name=zone value=EST>
If YOU See this SSI is not supported...</servlet>
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);
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: Server Side Includes.
It's not a secret anymore!