Two Laptop Bag*
The moose likes JSP and the fly likes Eclipse .jsp shows an error -- Httpsession cannot be resolved to a type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Eclipse .jsp shows an error -- Httpsession cannot be resolved to a type" Watch "Eclipse .jsp shows an error -- Httpsession cannot be resolved to a type" New topic
Author

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

Mark Wilberg
Greenhorn

Joined: Feb 05, 2011
Posts: 11
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

Joined: Jan 10, 2002
Posts: 60822
    
  65

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?


  • [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    David O'Meara
    Rancher

    Joined: Mar 06, 2001
    Posts: 13459

    a few things
    * @Bear
    * yes, you still need to import the class similar to regular Java code
    Mark Wilberg
    Greenhorn

    Joined: Feb 05, 2011
    Posts: 11
    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

    Joined: Jul 06, 2005
    Posts: 1016
    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}
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Eclipse .jsp shows an error -- Httpsession cannot be resolved to a type
     
    Similar Threads
    Working with SimpleDateFormat and DAte classes
    Value in dropdown from servlet
    <jsp:useBean ... type="package.class"> is not finding the bean class
    Session Attribute from the struts tags
    Can't deploy code for taglibs on Tomcat 5.5