Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse .jsp shows an error -- Httpsession cannot be resolved to a type

 
Mark Wilberg
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This time its jsp that i've bumped into

Eclipse shows the error at this line
Httpsession cannot be resolved to a type
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few things:
  • Java code in a JSP is a really poor practice that has been discredited for almost 10 years now. Time to move on.
  • If you insist, did you import the class?
  •  
    David O'Meara
    Rancher
    Posts: 13459
    Android Eclipse IDE Ubuntu
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    a few things
    * @Bear
    * yes, you still need to import the class similar to regular Java code
     
    Mark Wilberg
    Greenhorn
    Posts: 11
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks,
    Solved................Never thought that would be that simple! Code worked fine in Windows. Guess some changes have to be incorporated in Linux.
     
    Stefan Evans
    Bartender
    Pie
    Posts: 1670
    10
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Is it worth pointing out that there is already an implicit variable called "session" for a JSP?

    So it could just be



    But I prefer using EL and ${sessionScope.id} or even just ${id}
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic