0

Hi I'm working on Glassfish 4, Java EE7. I want to show my images that I had saved in a folder named "Uploaded" like this

                <image src="/uploads/image1.png" />

when I was working on tomcat7 I was changing the conf/server.xml by adding this line under the <host>

<Context docBase="c:/uploads" path="/uploads" />

I found that on Glassfish 3, the equivalent is to add an alternatedocroot to the glassfish-web.xml like this:

<property name="alternatedocroot_1" value="from=/uploads/* dir=/c:/uploads" />

It didn't work for me on Glassfish 4 and I am wondering why this have changed in GF4.

I want to add the folder as a "virtual context" of the servletcontainer... Please if any one have idea. enter image description here

1 Answers1

1

The from represents the part of the full path that's exposed in the public (and thus visible in the URL). Basically, the composition of the dir and from should represent the full path.

<property name="alternatedocroot_1" value="from=/uploads/* dir=/c:" />
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555