views:

19

answers:

2

Now I have several wars and each runs when typing in browser localhost:8080/app1 or localhost:8080/app2 etc.

When I type http://localhost:8080, appears only the default page. I want to make app1 as default app, i.e. it must appear when typing localhost:8080 and others apps as secondary i.e. they must appear when typing localhost:8080/app2. How can I do it? Thanks in advance!

A: 

You need to provide a context-root node in WEB-INF/sun-web.xml.

From http://www.sun.com/bigadmin/sundocs/articles/urlrdn.jsp:

<sun-web-app>
<context-root>/mywarname</context-root>
</sun-web-app>

My guess would be that saying just / will make it the root application.

(Note that the mechanism is different when deploying inside an EAR)

Thorbjørn Ravn Andersen
A: 

If you are deploying manually through the Admin Console, the context root will (by default) be set to the name of the .war.

You can override this in the "Deploy Web Application" screen. You'll want to change the value of the "Context Root" input to / after selecting your .war but before clicking "OK".

Nick