aspose file tools*
The moose likes Servlets and the fly likes how to use ssi in servlets using apache web server and jserv Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to use ssi in servlets using apache web server and jserv" Watch "how to use ssi in servlets using apache web server and jserv" New topic
Author

how to use ssi in servlets using apache web server and jserv

arvind
Greenhorn

Joined: Aug 27, 2001
Posts: 11
dear friends,
i would like someone to guide me as how to use server side includes in servlets using apache web server(1.3.12 ver) and jserv.i have got a servlets folder on the server were i kept all my .class files and in the htdocs file i kept my html and shtml files .
the contents of my shtml file is as follows:
<html>
<head><title>SHTML test</title></head>
<body>
<h1>#1</h1>
Your IP address is <!--#echo var="REMOTE_ADDR"-->.
<h1>#2</h1>
This document's filename is <!--#echo var="DOCUMENT_NAME"-->.
<h1>#3</h1>
The Universal Time Coordinate is <!--#exec cmd="/bin/date --utc"-->.
Running another program makes for an example, but note
that the current time is available like so:
<!--#echo var="DATE_LOCAL"-->.
<h1>#4</h1>
Here I include a footnote.
<hr>
<!--#include file="footer.html"-->
<servlet code="http://server-ip address/servlets/SimpleServlet">
</servlet>
</body>
</html>
the contents of servlet is as follows:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SimpleServlet extends HttpServlet
{

public void doGet (
HttpServletRequestrequest,
HttpServletResponseresponse
) throws ServletException, IOException
{
PrintWriterout;
Stringtitle = "Simple Servlet Output";
//String p1=request.getParameter("param");
out = response.getWriter();

out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY>");
out.println("<H1>" + title + "</H1>");
out.println("<P>This is output from SimpleServlet.");
//out.println("check "+p1);
out.println("</BODY></HTML>");
out.close();
}
}
kindly let me know at the earliest.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use ssi in servlets using apache web server and jserv