Friday, April 1, 2011

Using virtual directory mapping in production mode

Its a facility in which you can place all your JPEG or video files in one location and many deployables can access it from that common location.
i implemented <virtual-directory-mapping> in my deployment and placed a text file in the virtual directory and am able to access the text file via a browser after deployment.
However whenever i make random changes to the text file, the changed values are not reflected in the browser page dynamically/immediately.
However when i tried this on my development domain it worked for me.I was able to see the changed values instantly after updating the text file. I changed the development domain to production mode and it still worked for me.
Later when I created a new domain in Production mode I was not able see the changes anymore.

Weblogic.xml (dev)
````````````````````````
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<context-root>/cplus</context-root>
                <virtual-directory-mapping>
                                <local-path>C:\temp\docroot</local-path>
                                <url-pattern>*.txt</url-pattern>
                </virtual-directory-mapping>
</weblogic-web-app>

I did the following change to weblogic.xml and it works in prod mode aswell.

Weblogic.xml (Prod)
'''''''''''''''''''''''''''''''''''
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<context-root>/cplus</context-root>
<jsp-descriptor>
    <page-check-seconds>1</page-check-seconds>
    <verbose>true</verbose>
  </jsp-descriptor>
    <virtual-directory-mapping>
        <local-path>C:\temp\docroot</local-path>
        <url-pattern>*.txt</url-pattern>
    </virtual-directory-mapping>
</weblogic-web-app>

ref: http://download.oracle.com/docs/cd/E17904_01/web.1111/e13712/weblogic_xml.htm#i1075630

No comments: