Webnet Webnet - 2 months ago 11
Java Question

How to remove my application name from the URL?

When I go into my Glassfish admin panel I go to Applications and I see my application listed (named

cmt
). When I click Launch it opens a tab with some URLs. There are a few issues with these URLs I'm struggling to find answers for on how to fix.


  1. I only want HTTPS, not http. Is this controller on the server or application level?

  2. These URLs have
    /cmt
    on the end of the domain name. I really need the user to access my application on the base url without having a
    /cmt
    on the end. How can I control this?



Thanks for your help!

Answer

As to your first question, if you want to require SSL connections to your web application then you are going to have to do some additional server configuration. I will refer you to this tutorial.

For your second question, change your web.xml and set its context root to /:

<context-root>/</context-root>