1

I have this project name in my eclipse 'abc-work' and when I run it on localhost the url is

http://localhost:8080/abc-work

The default file or page that opens is (as per web.xml below)

<display-name>abc-work</display-name>
  <welcome-file-list>
    <welcome-file>account/login.xhtml</welcome-file>
  </welcome-file-list>

I successfully deployed this application on a cloud and linked it to my domain.

The URL now is:

http://www.abcwork.in/abc-work/

Now, the problem is - I need to remove the last /abc-work/ from this link, login page should directly open with the link http://www.abcwork.in/

My project is in Glassfish 3.1.2

I need to make this change, maybe by URL rewriting in web.xml, but I have no clue how to achieve it.

I have tried changing context root from Eclipse project properties, tried changing glassfish-web.xml's context root too - did not work for me.

Any help shall be highly appreciated. Thanks.

DIM
  • 73
  • 1
  • 10
  • Does this help? https://alexismp.wordpress.com/2007/08/30/glassfish-tip-have-your-application-be-the-root-application/ – dnault Apr 13 '15 at 08:27

1 Answers1

1

Option 1: You can set one of your webapps as default. This can be done with the admin console:

Configuration --> Virtual Servers --> server

Then select your default web application from the drop-down menu. If your webserver port is 8080, you can start your application now by:

http://hostname:8080

instead of http://hostname:8080/webapp

Notice that "server" is the name of Glassfish's default virtual server. If you configured a different virtual server for your webapp you need to change it accordingly.

Furthermore regarding this source, there might be some problems with JDBCRealms.

Option 2: You could also deploy your default webapp to "/" instead of "/webapp" but I think the first option is more flexible.

flafoux
  • 2,080
  • 1
  • 12
  • 13
  • Perfect, option 1 works for me. Thanks a million for your help! – DIM Apr 13 '15 at 08:54
  • Since the provided solution worked out your problem, it would be nice if you mark the answer as correct as an addition to the million of thanks ) – jjd Apr 15 '15 at 21:35
  • I have no such and option "Configuration --> Virtual Servers --> servers" – IntoTheDeep Apr 09 '16 at 16:09