2

Situation: I installed Eclipse 4.3 (Kepler) with the JBoss Tools and added the WildFly 8.0 Application Server. Then I created a simple JavaEE7-HelloWorld pom.xml, for maven-support. I included this pom.xml in Eclipse. I see the JavaEE project structure.

Problem: I want to add some static file (e.g., html, images and css) to that project. I tried everything, but I can't find the correct place to put the static files.

Dennis
  • 4,011
  • 7
  • 36
  • 50
  • 2
    Probably didn't actually try everything, then. In Maven, web app resources go in `src/main/webapp`. http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html – Dave Newton May 09 '14 at 13:54
  • Then you probably have something configured incorrectly. Are you using an Eclipse Maven plugin of some sort? If not, you'll need to define the web artifact stuff yourself. – Dave Newton May 09 '14 at 14:16
  • 1
    Yes, it does work. So if it is not working for you, obviously there is something wrong with your setup and you need to investigate. Might be that the deployment assembly is fudged up for example. – Gimby May 09 '14 at 14:17
  • I just reimported the pom.xml; now the folder `src/main/webapp` was created and an `index.html` is working now. Weird. – Dennis May 09 '14 at 14:18

1 Answers1

0

You have to configure a servlet to serve static content, and then put your static content into the directory you specify.

Here's a question with some good examples: Servlet for serving static content

You have deploy and app to your app server that knows how to serve static content.

Community
  • 1
  • 1
mikeb
  • 10,578
  • 7
  • 62
  • 120
  • If I create a "Dynamic Web Project" in Eclipse (without maven), then I can simple add the static content to the `WebContent` folder, which does not exist within the maven project.. – Dennis May 09 '14 at 14:02