Using the context-root from glassfish-web.xml in GlassFish 3

前端 未结 2 545
遥遥无期
遥遥无期 2020-12-01 22:25

We recently switched to Glassfish 3.1.2.2 and have several Web-Applications packaged as war files. At times the desired context-root for these applications differs from the

相关标签:
2条回答
  • 2020-12-01 23:00

    Normally this should work with a glassfish-web.xml looking like this:

    <!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">
    <glassfish-web-app>
        <context-root>/path/to/App</context-root>
    </glassfish-web-app>
    

    But here it looks like you need a file called sun-web.xml for your task.

    Here is an example:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC 
         "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Servlet 3.0//EN"   
         "http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd">
    <sun-web-app error-url="">
        <context-root>/path/to/our/App</context-root>
    </sun-web-app>
    
    0 讨论(0)
  • 2020-12-01 23:08

    In GlassFish 3 and GlassFish 4 the configuration of a web application is done via glassfish-web.xml. In your case the desired configuration file would look like this:

    <!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">
    <glassfish-web-app>
        <context-root>/path/to/our/App</context-root>
    </glassfish-web-app>
    

    You can find further details in section GlassFish Server Deployment Descriptor Files of Oracle GlassFish Server Application Deployment Guide. A online version of this document can be found at http://docs.oracle.com/cd/E18930_01/html/821-2417/.

    0 讨论(0)
提交回复
热议问题