How about calling
out.close()

Stefanos

Steve Burrus wrote:

*It's very good indeed to be back in your "midst" again, and believe me, I will try hard to "mind my manners" and try to use this list for the most knowledgeable insight that I can posssibly get about how to execute certain jsp's/servlets with the Tomcat web container!!*

*Case in point: I am having problems with trying to see this "TodayServlet.java" servlet of mine. It just flat doesn't show up in my browser when I try to look at it, sad to say. It is just the most simple and basic servlet, so it shouldn't be too much of a "big deal" to correct whatever problem it has, so I could then see it. I naturally have attached it to my posting, and again, it's good to be back "in your good graces" again. *

*p.s.: excuse my absolute ignorance about how servlet creation is done successfully, but I was wondering if I possibly need a HTML file to go along with this servlet as a helper file.*

------------------------------------------------------------------------

import java.io.*;
import java.util.Date;
import javax.servlet.*;
import javax.servlet.http.*;

public class TodayServlet extends HttpServlet {

public void doGet( HttpServletRequest request, HttpServletResponse response )
throws IOException, ServletException {
response.setContentType( "text/HTML" );
response.setHeader( "Pragma", "no cache" ); response.setHeader( "Cache-Control", "no cache" );
response.setHeader( "Expires", "0" );
PrintWriter out = response.getWriter();
out.println( "<HTML>" );
out.println( "<head>" );
out.println( "<title>Today</title>" );
out.println( "</head>" );
out.println( "<body bgcolor='000000' text='ffff10'>" );
out.println("<h1>The Date and Time, if u didn't know,is:</h1>" );
Date today = new Date(); out.println( "<p>" + today + "</p>" );
out.flush();
out.println( "</body>" );
out.println( "</HTML>" );
}
}


------------------------------------------------------------------------

<!DOCTYPE web-app PUBLIC
  "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd";>

<web-app>

<display-name>
How to program servlet examples </display-name>


<description>
this is the web app. in which we show our servlets/jsp's. </description>


<servlet>
   <servlet-name>today</servlet-name>
   <servlet-class>TodayServlet</servlet-class>
</servlet>

<servlet-mapping>
   <servlet-name>today</servlet-name>
   <url-pattern>/today</url-pattern>
</servlet-mapping>
</web-app>



------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to