facebook

WebProject tutorial

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

    I did the demo of WebProject tutorial, but after i init:

    HelloWorld hw = new HelloWorld();
    hw.sayHello(); <- this line is marked error, saying sayHello is undefined for the type HelloWorld.
    But the page works properly.

    what’s going on there ?

    thanks so much

    #225769 Reply

    Riyad Kalla
    Member

    Is your JSP page named “HelloWorld.jsp” as well? If so, please do not name classes and JSP pages the same name, the reason is that there is currently a bug where during validation both are compiled to class files (ending up in 2 separate files with the same name that USE eachother) so likely the validator is thinking you mean your JSP page when you say “HelloWorld hw” which obviously is not what you wanted.

    The reason this works in app servers is because they will prefix/suffix the JSP page with some constant string like “_jsp_page.java” when it is converted.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: WebProject tutorial

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