• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cannot resolve Symbol

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I instantiated a HttpSession object


and then attempted


But my Idea (IDE) flags "getAttribute" in the above statement and complains that it cannot resolve Symbol.

I do not understand how this can happen as the HttpSession object should have a getAttribute method which accepts a string argument.
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What if you try it like this?

 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I try the version with the toString() method, the result is the same.
Note: I obtained the source by deploying a .war file I downloaded. The application byte code which maps to the source runs fine in Tomcat5.5. This would seem to indicate that the problem lies with my IDE (IntelliJ Idea) or with an incompatibility with servlets.jar. But all documentation which I have seen indicates that getAttribute(String) is a method in HttpSession.
 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suspect it's a version thing, check the version of the servlet api maybe?
 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestion. I was in the process of narrowing this down. I had downloaded and installed Sun's Enterprise IDE and experienced no problems compiling in that environment. I also noticed that in Sun's environment there was no servlets.jar file, everything needed for app server packaged together in j2ee.jar. So I added j2ee.jar to my IntelliJ Idea project classpath and problem solved! Thanks to all who have helped me with this problem.
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic