users@glassfish.java.net

Re: set Context root of an J2EE enterprise application

From: mSephiroth <moi87g_2_at_yahoo.com>
Date: Wed, 24 Mar 2010 14:36:25 -0700 (PDT)

Thx for the answer, it work fine!!

>
> hi, txh for the answer, just tell me where are those
> files(sun-application.xml, application.xml) cuz in my EA'folder arenot
> those files. escuseme if me question is funny.
>
>
No, this is not a silly question at all. As application.xml is now optional
(starting from JavaEE5), the tools probably stops generating it by default.

Ludo/Vince: is there an easy way to add an application.xml through NB 6.8?

You could always manually add it to the top level META-INF directory. This
is a sample of it. Here the context root of the war is set to "helloworld".

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="6"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_6.xsd">
  <display-name>HelloWorld</display-name>
  <module>
    <ejb>stateless-simpleEjb.jar</ejb>
  </module>
  <module>
    <web>
      <web-uri>stateless-simple.war</web-uri>
      <context-root>helloworld</context-root>
    </web>
  </module>
</application>

- Hong


Hong Zhang wrote:
>
> To change the context root of a war inside an enterprise application,
> you will need to change its context root in application.xml (or
> sun-application.xml).
>
> mSephiroth wrote:
>
>>Hi all,
>>
>>Im Using a NetBeans 6.8 for Linux and glassfish v3, I did create an
>>enterprise application named 'sistemA' using j2ee6.
>>
>>The server works fine, I did deploy the application without any problem.
the
>>app has an EJB module 'sistemA-ejb.jar' and a web module
'sistemA-war.war',
>>the problem is that i want to access my web app using
http://localhost:8080/
>>and not http:localhost:8080/sistemA-war/
>>
>>i proceeded to edit the sun-web.xml file on the web module 'sistemA-war'
but
>>im still not able to access my web app using http://localhost:8080/, is
>>there some other way to do this?
>>
>>THX
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>

-- 
View this message in context: http://old.nabble.com/set-Context-root-of-an-J2EE-enterprise-application-tp28011684p28021738.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.