English 中文(简体)
Eclipse Indigo and Maven : Unable to found src/main/java in Dynamic web Project
原标题:Eclipse Indigo and Maven : Unable to find src/main/java in dynamic web project
最佳回答

That s exactly how we do it. src/main/java, src/test/java and src/test/resources under java resources -> new source folder

如果你想通过散射从碎片上管理网络,则要把你的弧/主要/java道路和天候附属物添加到你的项目部署大会。

http://www.ohchr.org。

Concerning Eclipse Deployment:

如果该项目已经像你一样作为一个动态的网络项目出现,那么你需要增加服务器的服务器(我们使用Tomcat 7,并在服务器安装中参考当地目录)。

然后,在服务器上添加网标(服务器上加/移转)。

在项目特性中,你需要把弧/主要/资源以及弧/main/java的夹子添加到你的部署大会和装配中。

我们还使用一个电弧/主要/网络应用夹,而不是自动创建的网络连接夹。 这拥有网络资源、WEB-INF和看法,并将补充到部署大会,并规划到根本的道路。

现在,你在座机上运行一个装置,然后选择在服务器上运行。

问题回答
  • Just after the creation of a web application based on the archetype maven-archetype-webapp , it is perfectly possible to run the wep application in making usage of run as on Tomcat (by example). You have right to a jsp page, index.jsp.
  • But if you want like many others create a servlet then you have a problem. The build path of the projects references src/main/java and src/test/java but the directories do net exist yet. I don t know why they forgot to create the directories (within the archetype)...
  • To correct the problem, you simply have to create the missing directories (from the explorer) and then from Eclipse do a right-click on the project name and then click on Maven and then Update Project . If you create the directories this way you will see that the source directories (src/main/java and src/test/java will appear again).
  • Then create a new servlet (by example) in src/main/java and deploy the application again. Everyting will work this time.




相关问题
Can t access locally hosted project via the internet?

I m currently developing a Java Servlet Project in Eclipse. The project is compiled via Tomcat 5.5 and hosted in localhost:8080(alternatively 127.0.0.1:8080 AND 192.168.1.10:8080 which also happens ...

JSP programmatically render

I need to programmatically render JSP page. As far as I understand, JSP should have some compiler. The question is can I use this compiler dirrectly without JspServlet and others? All I need is ...

Javascript redirect

I am working with javascript and here is what I am trying to do: 1. Send a get request which looks like "http://localhost:8080/myapp/verify.htm?verifyId=Agkvhs" My requests reaches my verify.jsp in ...

热门标签