users@glassfish.java.net

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

From: Vince Kraemer <vince.kraemer_at_oracle.com>
Date: Fri, 19 Aug 2011 12:10:51 -0700

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".
>
> (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">
> <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>

What file is this---^^^^^ in?

It looks like it is incorrect regardless of what you call it....

If this content is in a file named glassfish-web.xml, the doctype is
incorrect. It should be something like

<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish
Application Server 3.1 Servlet 3.0//EN"
"http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">

If the content is in a file named sun-web.xml, the root element is
incorrect. It should be something like

<sun-web-app>...</sun-web-app>

HTH,
vbk

>
> --
>
> [Message sent by forum member 'schnocky']
>
> View Post: http://forums.java.net/node/835558
>
>