• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can anybody help to getrid of this error?

 
ram sankar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i am using

<%
request.setHeader("Pragma", "no-cache");
request.setHeader("Cache-Control", "no-cache");
request.setDateHeader("Expires", 0);
%>
above code in my jsp page.I am getting the following error can any body please help to rectify this error.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 115 in the jsp file: /client/TreeStructure.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\LITMUSEDU\org\apache\jsp\client\TreeStructure_jsp.java:187: cannot resolve symbol
symbol : method setHeader (java.lang.String,java.lang.String)
location: interface javax.servlet.http.HttpServletRequest
request.setHeader("Pragma", "no-cache");
^


An error occurred at line: 115 in the jsp file: /client/TreeStructure.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\LITMUSEDU\org\apache\jsp\client\TreeStructure_jsp.java:188: cannot resolve symbol
symbol : method setHeader (java.lang.String,java.lang.String)
location: interface javax.servlet.http.HttpServletRequest
request.setHeader("Cache-Control", "no-cache");
^


An error occurred at line: 115 in the jsp file: /client/TreeStructure.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\LITMUSEDU\org\apache\jsp\client\TreeStructure_jsp.java:189: cannot resolve symbol
symbol : method setDateHeader (java.lang.String,int)
location: interface javax.servlet.http.HttpServletRequest
request.setDateHeader("Expires", 0);
^
3 errors


Thanks & Regards
RamSankar
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be response.setHeader.
 
paritosh ranjan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always remember,you get headers out of request,and set headers into response.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!