users@glassfish.java.net

Re: context-root parameter ignored in glassfish-web.xml

From: ludo mails <ludomails_at_gmail.com>
Date: Fri, 19 Aug 2011 20:35:22 -0700

Hi

On Fri, Aug 19, 2011 at 12:12 PM, <forums_at_java.net> wrote:

> I created a new "Dynamic Web Project" in eclipse. Used the OEPE plugin to
> deploy to Glassfish 3.1 and 3.1.1. Even though I try to override the
> context
> root in the glassfish-web.xml (or sun-web.xml for that matter), Glassfish
> maintains the default context URL for the application. I can change and
> save
> it in Glassfish using the console, but that is overwritten the next time I
> deploy.
>
> Steps to repeat.
>
> (1) Create a new Dynamic Web Application in Eclipse.
>
> (2) Modify the sun-web.xml to set context root to "/anything".
>

Well, the Eclipse setting is winning there.
To change the context root in Eclipse, you need to edit the project
properties
and in the "Web Project Settings" node, there is a context root entry field
you can modify...
There is no listener in the Eclipse IDE to allow automatic change between
the 2 values...

Ludo

>
> (3) From the servers pane, right click on the server and select Add/Remove
> to
> deploy the app.
>
> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sun-web-app PUBLIC "-//Sun
> Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
> "http://www.sun.com/software/**appserver/dtds/sun-web-app_2_**5-0.dtd<http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd>
> ">
> <glassfish-web-app error-url=""> <context-root>/lookhere</**context-root>
> <class-loader delegate="false"/> <jsp-config> <property
> name="keepgenerated"
> value="true"> <description>Keep a copy of the generated servlet class java
> code.</description> </property> </jsp-config> </glassfish-web-app>
>
> --
>
> [Message sent by forum member 'schnocky']
>
> View Post: http://forums.java.net/node/**835558<http://forums.java.net/node/835558>
>
>
>