Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse complains about undefined type.

 
Bob Hysell
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have jsp page with the directive <%@ page import="ppr_tv.javaSrc.UserBean"%> and the statement <jsp:useBean id="currentSessionUser" class="ppr_tv.javaSrc.UserBean" scope="session"> </jsp:useBean>.
This page loads and displays fine and I have full access to the UserBean class. But in the Eclipse IDE the class value of "ppr_tv.javaSrc.UserBean" is underlined in red with the error "Undefined type: ppr_tv.javaSrc.UserBean". I am not sure why it is complaining.

I have tried changing the directive to <%@ page import="ppr_tv.javaSrc.*"%>. The application still works but the error message persists.
I have also tried changing the class value from "ppr_tv.javaSrc.UserBean" to "UserBean". The error remains and the application does not work.

Perhaps this is not a big deal as the application works. Still, things underlined in red just rub me the wrong way. ;-)
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the UserBean class located? Is it in the same project as the JSP file? If not, does the Eclipse project include the JAR containing UserBean?
 
Bob Hysell
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UserBean is in the same directory as all the other project java files.
 
Bob Hysell
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved.
My Servlet already states: package ppr_tv.javaSrc;

But when I also added:
import ppr_tv.javaSrc.UserBean;
import ppr_tv.javaSrc.SearchBean;

the error message and red underline went away.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic