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: 41096

should read:

Both methods are in HttpServletResponse, not ServletResponse.

Ping & DNS - my free Android networking tools app
Consider Paul's rocket mass heater.
subject: why error in setHeader()
Similar Threads
how to acces a remote servlet from a java client?????
Cannot able to Find Methods
Software requirements??
compiling and deploying into Tomcat
PersonalizeWelcome servlet question...