This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Deploying static content on JBoss 7  RSS feed

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using JBoss 7.1.0.AS. I have a simple directory consisting of a bunch of static files. Is there a way I can copy this directory somewhere on my JBoss server and have the files served? I tried copying my directory (named "test") into the root web folder where other Java WAR files are located, but sadly, when I visit http://localhost/test/example.jpg (an example file I have), I get a 404.

Grateful for any pointers in the right direction, - Dave
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put them in the root folder of any of your web apps (war files) just like you do with JSP or JSF, or whatever page format you use. You can also put them in the welcome-content folder, as long as you haven't disabled that in your configuration. Your config file (e.g. standalone.xml) should have: in the server definition.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!