wood burning stoves
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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 java.io.*;
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: 42959

should read:

Both methods are in HttpServletResponse, not ServletResponse.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: why error in setHeader()
It's not a secret anymore!