2 Replies - 3785 Views - Last Post: 29 June 2011 - 10:36 PM

#1 laishrametao  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-February 11

The method getAttribute(String) from the type HttpSession refers to...

Posted 28 June 2011 - 11:05 AM

I am developing a project using Eclipse IDE and I am getting this error

"The method getAttribute(String) from the type HttpSession refers to the missing type Object"
in the following jsp code


     <% if(session.getAttribute("user") == null)
	{
      %>
        <a href="login.jsp">Login</a> 
      <% 
	}
	else
	{
      %>
        <a href="logout.jsp">Logout</a>
      <%
	}
      %> 
  </div>
  </div>
  <div id="navBar">
    <ul>
      <li><a href="search.jsp">Search</a></li>
     <% 
	if(session.getAttribute("user") != null)
	{
		dao.User user = (dao.User)session.getAttribute("user");
     %>
      <li><a href="issue.jsp">Issue</a></li>
      <li><a href="return.jsp" >Return</a></li>
     <%
	if(user.getRole().equals("Librarian")) 
	{
     %>
      <li><a href="reportshome.jsp">Reports</a></li>
      <li><a href="admin.jsp">Administration</a></li> 
     <% 
	}
     %>
		<li>Hi <%=user.getName()%>!</li> 
     <%	
	} 
     %>
  


what might be the possible reasons behind this error?

Is This A Good Question/Topic? 0
  • +

Replies To: The method getAttribute(String) from the type HttpSession refers to...

#2 japanir  Icon User is offline

  • jaVanir
  • member icon

Reputation: 1010
  • View blog
  • Posts: 3,025
  • Joined: 20-August 09

Re: The method getAttribute(String) from the type HttpSession refers to...

Posted 29 June 2011 - 09:51 AM

What jdk are you using?
Also, check what jdk the IDE (eclipse) is pointing to.
Was This Post Helpful? 0
  • +
  • -

#3 laishrametao  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-February 11

Re: The method getAttribute(String) from the type HttpSession refers to...

Posted 29 June 2011 - 10:36 PM

I am using JDK 1.6 and it is also pointing at the same.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1