Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

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

Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
<head><title>SHTML test</title></head>
Your IP address is <!--#echo var="REMOTE_ADDR"-->.
This document's filename is <!--#echo var="DOCUMENT_NAME"-->.
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"-->.
Here I include a footnote.
<!--#include file="footer.html"-->
<servlet code="http://server-ip address/servlets/SimpleServlet">
the contents of servlet is as follows:
import javax.servlet.*;
import javax.servlet.http.*;
public class SimpleServlet extends HttpServlet

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

out.println("<H1>" + title + "</H1>");
out.println("<P>This is output from SimpleServlet.");
//out.println("check "+p1);
kindly let me know at the earliest.
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic