File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes why error in setHeader() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "why error in setHeader()" Watch "why error in setHeader()" New topic

why error in setHeader()

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
import javax.servlet.*;
import javax.servlet.http.*;

public class first extends HttpServlet{
public void doGet(ServletRequest req,ServletResponse res) throws ServletException,IOException{
PrintWriter out=res.getWriter();
long mseconds;
java.util.Date date=new java.util.Date();
mseconds=date.getTime() + 10000;
out.println(new java.util.Date());

Dear sir in the above code when i am compiling this program then there is a two error that
can't find symbole setHeader()
can't find symbole setDateHeader()
why sir why?
with regard
Arun kumar maalik
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965

should read:

Both methods are in HttpServletResponse, not ServletResponse.
I agree. Here's the link:
subject: why error in setHeader()
It's not a secret anymore!