Search code examples
javaeclipsejspscriptlet

Eclipse isn't updating custom methods in JSP scriptlets


I'm editing a Dynamic Web Project, with a simple class in the project's /src folder, and a .jsp page to access it.

Within Eclipse, .jsp page only recognizes some of the methods in my class as existing -- other classes get "The method ... is undefined" and "The method ... is not visible", even though the code all compiles and works like I would expect it to. But this only happens sometimes.

<%
myConnectionDBO = ConnectionDBO.getInstance();
out.println("Is connected? "
        + myConnectionDBO.isConnected()
        + "<br>");
out.println("Attempting resultset grab...<br>");

ResultSet rs = myConnectionDBO.doSelectWhere(1);
%>
  • .getInstance() doesn't have any syntax errors (but it should, because it was added later).
  • .isConnected() shows an undefined error (false positive).
  • .doSelectWhere() shows "is not visible" and "cannot convert from void to ResultSet" (ditto).

Before you ask, I have rebuilt/cleaned my project, refreshed it from the Project Explorer, auto-build is enabled, restarted my application server (JBoss), and restarted Eclipse. The problems remain.


Solution

  • Despite the fact that you MUST do what the previous post recommends (JSTL + EL = awesomness) i'm wondering wether you missed the <%@ page ...> directive to import classes that would contain the definition of those methods.