facebook

Tutorial project: Import conflict and method undefined!

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #236102 Reply

    horinius
    Participant

    I’m a new user to MyEclipse (but not to Eclipse), and so I’ve followed this online tutorial provided by MyEclipse.

    Since it shows a different interface, the tutorial is probably for previous version, but no problem because I managed to cope with most of the problems, except the following two:

    1) I’ve followed the creation of the HelloWorld.java class and used the same package name, com.genuitec.test. Then I’ve also created the helloWorld.jsp and put in everything shown in the tutorial. However, after I’ve typed

    HelloWorld hw = new HelloWorld();

    the corresponding import isn’t created. No problem, I added manually this line:

    <%@ page import="com.genuitec.test.HelloWorld"%>

    but Eclipse underlines the import name with red line ❗ The reason (as shown in the small red box next to the vertical scrollbar) is
    “The import com.genuitec.test.HelloWorld conflicts with a type defined in the same file (in file:”com.genuitec.test.HelloWorld”)”

    What’s wrong???

    I’ve found that if I change the line to become

    <%@ page import="com.genuitec.test.*"%>

    , it’s not longer underlined. Well, for this part, maybe the problem is solved!?

    2) I then typed in

    out.println("message = " + hw.helloWorld());

    and this time, it’s helloWorld method which is underlined in red. The reason is
    “The method helloWorld() is undefined for the type HelloWorld”

    Despite all this, if I deploy the project to my Tomcat5, the webpage is still displayed correctly.

    Could somebody tell me if I still to do some more setting or did what?

    #236167

    Riyad Kalla
    Member

    All of these issues stem from a bug we have where the JSP editor doesn’t like you to have Classes that are the same name as your JSP files, if you change your jSP name to index.jsp or something else, it should work. Sorry for the trouble.

    #236187

    horinius
    Participant

    Oh!

    Is this bug supposed to be solved soon? If not, please add it to your FAQ. Some others might come across the same problem. BTW, your FAQ doesn’t have a sort of “date-stamp”, ie the date when that FAQ was written. When someone sees that the FAQ is, say, one year old, he might think a new version would have corrected it, provided he’s not using a new version.

    Thanks for your great product!

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Tutorial project: Import conflict and method undefined!

You must be logged in to post in the forum log in