0

I have tomcat7 server in it I have upload .war file in webapps directory. After that we access it url "localhost:8080/warfile"

But here I want that we access .war in this url "localhost:8080" is it possible, if yes then please help me

thanks

priyanka
  • 197
  • 2
  • 12
chander
  • 41
  • 1
  • 1
  • 4

1 Answers1

-1

Rename your war file to ROOT.war, to access it via yourhost.com rather than yourhost.com/nameOfWar.

Also, especially in a local environment, set the path variable to "/" in your server.xml. In eclipse, you will probably have a "Servers" project folder, where you can simply edit the server.xml of the specific tomcat server.

<Context docBase="YourApp" path="/" reloadable="true"
                    source="org.eclipse.jst.jee.server:YourApp" />
kevcodez
  • 1,261
  • 12
  • 27
  • Thanks sir for valuable reply – chander Jul 07 '15 at 12:15
  • But, what is url of it after do this – chander Jul 07 '15 at 12:16
  • If it works, please mark it as solved and upvote. In a local environment, the url will be localhost:8080/ rather than localhost:8080/yourapp. – kevcodez Jul 07 '15 at 12:16
  • "If it works, please mark it as solved and upvote. In a local environment, the url will be localhost:8080/ rather than localhost:8080/yourapp " here if i want open my .war file in url "localhost:8080/myapp" instead of "localhost:8080" then what i can do for this – chander Jul 08 '15 at 06:59
  • Did you even try what I wrote? Edit the path attribute in your server.xml. – kevcodez Jul 08 '15 at 12:39