users@glassfish.java.net

Re: Static Content in Glassfish

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Thu, 08 Mar 2007 17:31:12 -0800

Jesse,

glassfish_at_javadesktop.org wrote On 03/08/07 03:41 PM,:

>Jan,
>
>Thank you for the quick response.
>
>I just executed a fresh install of the Glassfish Build 38 and I still haven't had any luck. This time I am trying to serve up a picture located at "/srv/pics/logo-Ubuntu.png" when the user enters the URL http://localhost:8080/pics/logo-Ubuntu.png . So, I have added the property named "alternatedocroot_1" with the value of "from=/pics/* dir=/srv/pics" to the virtual server "server".
>
>At this point I don't have any webapps deployed to make sure that the settings are not getting "shadowed".
>
>When I am saying the directory /srv/pics I mean the directory /srv/pics at the root of the file system.
>

Yes, that's fine.

I just noticed what's wrong with your config. :)
Try to specify the value of your alternate docroot as follows:

  "from=/pics/* dir=/srv"

This way, this request:

  http://localhost:8080/pics/logo-Ubuntu.png

will be served from

  /src/pics/logo-Ubuntu.png

Once a path has been mapped to an alternate docroot, it will be appended
"in full" to the alternate docroot's directory, just as it is normally
appended
"in full" to the docroot's physical location when no alternate docroots are
specified or no matching docroot was found.

Can you give this a try?


Jan


> Is this correct or this supposed to go somewhere in the glassfish directory? Possibly in the domain1 directory?
>
>Thank you again, Jesse
>[Message sent by forum member 'manbeast7' (manbeast7)]
>
>http://forums.java.net/jive/thread.jspa?messageID=207007
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>