users@glassfish.java.net

Re: Static Content in Glassfish

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Mar 2007 05:01:56 PST

I am using Glassfish v2 Build 33 and I tried adding a virtual directory mapping by following http://blogs.sun.com/jluehe/entry/new_support_for_virtual_directory

Thus far I have been unsuccessful but I just wanted to clear a few things up before I went totally insane. My goal is to have my app load static content that is stored locally on my harddrive which is seperate from the WAR.

For example, I am storing XML docs locally at /srv/xml that I would like to be able to load from my application by going to "http://localhost:8080/xml-docs/" (i.e. http://localhost:8080/xml-docs/foo.xml). Via the admin console, I added a property named "alternatedocroot_1" with the value of "from=/xml-docs/* dir=/srv/xml" to the virtual server named "server".

After a restart of Glassfish, shouldn't I be able to access the XML file by going to http://localhost:8080/xml-docs/foo.xml? Am I heading in the right direction? Or am I way off?

Any help is greatly appreciated, Jesse
[Message sent by forum member 'manbeast7' (manbeast7)]

http://forums.java.net/jive/thread.jspa?messageID=206833