简体   繁体   中英

Eclipse doesn't build my java files in web app project

I have an open source project (WAR file) imported to my Eclipse.

I have all java code sources in WEB-INF/src/... folder.

I have User java file with following code:

public class User {
  public User () {}
  public void create (){}
  public void test(){}
}

Which create method has been made by the open source project creator, while test is new method that I create.

Then I tried to call from my login.jsp :

User user = new User ();
user.create();
user.test();

The user.test(); returns error The method test() is undefined for the type User , while the rest works fine.

I tried to check the build class and it only has the create method. Tried to clean and build the project, still doesn't resolve my problem. What is the cause of this error? Eclipse seems doesn't build my project.

This is quite strange since I did this before and didn't work, but now it works.

I resolve this problem by moving all the java codes from WebContent/WEB-INF/src/<my-package> to Java Resources/src/<my-package>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM