users@glassfish.java.net

Re: Anomaly changing web.xml on a directory deployed web app.

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Sun, 06 Jul 2008 22:23:38 +0200

glassfish_at_javadesktop.org wrote:
> I have a web app in a directory, that is deploy via the GUI console. Where it asks for a jar/directory name, I provide it with a directory.
>
> Everything was working fine. I've never had a problem updating JSPs and having them work on the fly, or updating classes and restarting the app and having it work.
>
> However, I have never had to actually redeploy the applications.
>
> Then, I changed the web.xml. After restarting the server, I found my changes weren't being recognized. My new JSPs were and other resources, but not my web.xml changes.
>
> Do I need to redeploy the web app after a web.xml change? Is that information cached somewhere? I'd rather not have to do that step if it's not necessary.

Yes, you have to redeploy the app. The web.xml that is actually used is
stored in generated/xml/j2ee-modules/yourwebappname/WEB-INF/web.xml. I
do _not know_ if deleting this file is a viable option. I would refrain
from deleting it.

But, if you have dynamic reloading enabled you could also add a
".reload"-file to the base of your web-app. Whenever you touch this file
(i.e. change its timestamp) your webapp gets reloaded.

You can verify if dynamic reloading is enabled in the webbased console
on the "Advanced" tab of the "Application Server" page.

On the command line you can use the following command to get the
relevant information:

asadmin get server.*.dynamic-reload*

The attribute dynamic-reload-enabled teklls you if dynamic reloading is
enabled. And the attribute dynamic-reload-poll-interval-in-seconds tells
you how often GlassFish checks for a new version of the ".reload"-file.

--
Wolfram Rittmeyer
> 
> Just looking for some clarification on how web.xml is used in this case.
> [Message sent by forum member 'whartung' (whartung)]
>