File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Cannot resolve symbol : request.setAttribute(.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Cannot resolve symbol : request.setAttribute(.." Watch "Cannot resolve symbol : request.setAttribute(.." New topic

Cannot resolve symbol : request.setAttribute(..

Ashley Copley

Joined: May 18, 2006
Posts: 3
I have jdk ver 1,4,2 installed and I am trying to build my application using ant script but get the error:
D:\test\action\ cannot resolve symbol
symbol : method setAttribute (java.lang.String,java.lang.String)
[javac] location: interface javax.servlet.http.HttpServletRequest
[javac] request.setAttribute("ACCOUNT_ID", accountId);
where accountId is a String in the code.
I also have servlet.jar and j2ee.jar set in my classpath and jdk's bin in the path in windows.
Could somebody resolve my issue?
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
This is the issue with the classpath..check the classpath again..and the method signature.Unable to find that method during compilation..

Rahul Bhattacharjee
LinkedIn - Blog
Ashley Copley

Joined: May 18, 2006
Posts: 3
I have a bunch of jar files into a directory and my classpath in my ant script points to that dir.

<path id="lib.classpath">
<fileset dir="${JARS}">
<include name="**/*.jar" />
<pathelement path="${CLASS_DIR}" />
My class path is fine.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Ashley Copley:
<path id="lib.classpath">

Is lib.classpath an Ant property?
If so, shouldn't you be using:
<path id="${lib.classpath}">

We have a forum specifically devoted to Ant and other build tools.
I'm going to move this thread there because this problem seems more to do with configuring classpaths in Ant than with servlets.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Cannot resolve symbol : request.setAttribute(..
It's not a secret anymore!