I've figured out how to serve static content, like a ton of images, that you don't 
want to put into a war file.

I've seen partial answers to this but noone really put it all together.

So, here's what you do:

--Create a directory on the server for the pictures or static content.  
--In this directory create another directory with a .war at the end of the name.    

  | Example: /opt/static_content/static_content.war  
  | 
         
--Place all pictures and static content jpgs in this the .war directory. 
         
--In your .war directory create a WEB-INF directory and place a property 
web.xml file in it.  This is an basicly exploded war file.  There doesn't 
have to be anything special in the web.xml, just valid web-app tags.

--Add new module in application.xml with your .war directory. 

  |    example: 
  |         <module>
  |              <web>
  |                  <web-uri>static_content.war</web-uri>
  |                  <context-root>/mypictures</context-root>
  |              </web>
  |         </module>
  | 
--edit /server/default/conf/jboss-service.xml and add the directory you 
added for the static content to URLS attribute tag inside 
the org.jboss.deployment.scanner.URLDeploymentScanner mbean

  |     example:             
  |            <attribute name="URLs">
  |                  deploy/, file:/opt/static_content/
  |            </attribute> 
  | 
This will let jboss scan that directory for any changes in that directory.
           
This needs to be the directory above the .war dir

Now you should be able to access your content by browing to the context

  | Example :<img src=" /mypictures/pic1.jpg"/>
  | 


Hope this helps some people out.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3823101#3823101

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3823101


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to