Try: ServletOutputStream out = res.getOutputStream();  // note capital S in
ServletOutputStream class name; this is the "symbol" the compiler can't
resolve in your program.

Also, it is highly unusual to override the service method; unless you have a
reason to do so, I believe it is more common to override the doGet and/or
doPost methods.

----- Original Message -----
From: Amba Ayambem <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 23, 2000 8:07 PM
Subject: Servlet newbie question


> Greetings all. I am new to java servlets and have recently installed the
> jsdk2.1. I have also written the following HelloWorld.java servlet:
>
> -----------------------------------------------------------------------
> import javax.servlet.GenericServlet;
> import javax.servlet.ServletException;
> import javax.servlet.ServletResponse;
> import javax.servlet.ServletRequest;
> import javax.servlet.ServletOutputStream;
> import java.io.IOException;
>
> public class HelloWorld extends javax.servlet.GenericServlet {
> public void service(ServletRequest req, ServletResponse res)
>         throws ServletException, IOException {
>         res.setContentType("text/html");
>        servletOutputStream out = res.getOutputStream();
>        out.println("Hello World");
> }
> }
> ----------------------------------------------------------------------
>
> The trouble is, when I try to compile it I get the following compiler
error:
>
> HelloWorld.java:12: cannot resolve symbol
> symbol : class  servletOutputStream
> location : class HelloWorld
>                 servletOutputStream out = res.getOutputStream();
>
> I have finally thrown in the towel on trying to figure out what in the
> world the "symbol" is that the compiler can't resolve. I need help!
> My CLASS contains C:\jsdk2.1 and
> my CLASSPATH contains C:\jsdk2.1\server.jar;.;C:\jsdk2.0\lib\jsdk.jar
> Thanks for any help.
>
> ---amba---
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to