Topic
  • 1 reply
  • Latest Post - ‏2012-11-15T15:13:58Z by SystemAdmin
RM03_Chris_Barlock
RM03_Chris_Barlock
1 Post

Pinned topic Setting Context Root to / ?

‏2012-11-14T16:20:07Z |
Is is possible to set the context root of a Liberty application to / so that the user just has to browse to:

http://<hostname>

rather than

http://<hostname>/<appname> ?

I tried adding context-root="/" to the application definition in server.xml. Some things worked, like the applications REST interface, but files were not found and the application failed to load in my browser.

Chris
  • SystemAdmin
    SystemAdmin
    590 Posts

    Re: Setting Context Root to / ?

    ‏2012-11-15T15:13:58Z  
    In order to change the context-root to just http://<hostname>, you need to add a parameter to your application's manifest file.

    Add to the end of your manifest file (META-INF/MANIFEST.MF) the following:

    Web-ContextPath: /

    This is part of the OSGi metadata that makes your application a WAB (Web Application Bundle).