I don't know if there is a feature that will let you do this directly from the Wildfly management or configurations, but I do know that it can easily be achieved via a very small web app deployment:

I put together this example for you just to demonstrate how simple it can be, this isn't an "official" approach, just one that you could use to achieve this result. It would also give the benefit of managing the static file-content of your system just like a normal deployment:

http://ocpsoft.org/java/servlet-java/creating-a-simple-static-file-server-with-rewrite/

Based on the configuration you pasted in your email, you would just deploy this application under the '/photo' context root.

I hope this is (at all) helpful.
~Lincoln


On Wed, Nov 13, 2013 at 8:36 AM, <weiqigao@gmail.com> wrote:
Hi jboss-as-7-dev (and wildfly-dev),

I signed up to the mailing lists to follow up on a post made on Fri Apr 20 05:13:56 EDT 2012 by Tom Fonteyne (tom.fonteyne at redhat.com):


> you'll need to do this on a per application basis now :(
>
> On 04/19/2012 07:44 PM, M. Steven wrote:
> > Hi,
> > > I am working on migrating an app from jboss 4.2 to 7.1.x. We used to
> > > map our static files using server.xml under jboss-web.deployer.
> > > Doing something like:
> > > <Context path="/photo" docBase="c:/test/images" reloadable="true"
> > > override="true">
> > > </Context>
> > > within server.xml.
> > > Now I can not figure out how to do it within Jboss AS 7. Can someone
> > > please help me on the issue?
> > > Thanks in advance.
> > > Regards,
> > > Mike
> --
> Tom Fonteyne
> Red Hat - UK
> EMEA GSS-SEG-Middleware

I have a client that is dealing with the same JBoss 4.2.x to JBoss 7.1.x migration issue, and I would appreciate it if a pointer can be given as to†*How* to do this on a per application basis in JBoss AS 7.1.x.† Similar questions on the JBoss.org forums and on StackOverflow are either Not Answered or provide answers that does not address exactly the same†problem.

The desired result is to have JBoss AS 7.1.x installed in one location on a host my-host, say, in /opt/appservers/jboss-as-7.1.x, and store some static web files (HTML files, images, and some such)†in another location on the same host, say, in /var/myapp/{foo.html,picture.png, etc.}, and have JBoss configured so that the static files can be accessed through the JBoss AS 7.1.x instance at some URL, say, http://my-host:8080/photo/{foo.html,picture.png, etc.} .

My current understanding of the situation is that the configuration/static-resources element in subsystem:web section of the standalone.xml (or domain.xml) file is used to control how static resources are handled within all deployed webapps.† But that applies only to the static resources that are part of the deployment (things thatís in the *.war file or exploded directory).

Is there an easy way to achieve what I wanted with JBoss AS 7.1.x configuration?

This issue constitutes lost functionality from an earlier version of JBoss to JBoss AS 7.1.x.† Is the elimination of the functionality intentional or merely a side effect of the changing configuration mechanism?† Is it the case that the underlying web container, (JBoss Web 7.0.14 I believe), still supports this functionality?† If so, are there plans to expose this functionality through some new element in the JBoss AS 7.1.x configuration files?

How will WildFly behave with regard to this scenario?

Regards,

_______________________________________________
jboss-as7-dev mailing list
jboss-as7-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev



--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."