• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat question

 
Roel De Nijs
Sheriff
Posts: 10591
140
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got http://localhost:8080/app and it's working fine. When i go to http://localhost:8080/ , i get the index.jsp page of directory ROOT. Is there any possible way to go to http://localhost:8080/app when some user types http://localhost:8080/
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Backup your server.xml before editing it!

look in your server.xml file and look at the <Host> tags

Find the one where "docBase" points to the ROOT folder and change that folder to your app folder.

That will point both /app and / to your same application.

Another option would be to change the "path" attribute in your apps <Host> to be "/" and then rename the one that said "/" before to be "/oldroot" or delete it altogether!
 
Roel De Nijs
Sheriff
Posts: 10591
140
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working with Tomcat 5.0.28 and i can't find a Host tag where docBase points to root. And i tought all the hosts-config files are under conf/Catalina/localhost. Also there isn't a ROOT.xml, where there is so for all my other web-apps.
So i added a Context-tag to server.xml as follows


and that does the job also, but in my web.xml of my web-app i got some env-entries and there aren't found when i go to this app with http://localhost:8080/ (So i guess i also have to put the web.xml of my app under the ROOT/WEB-INF/ )

if i go to url http://localhost:8080/ i got tomcat's homepage. Is there a possibility to disable this? I deleted the index.jsp and added a index.html saying "Forbidden, no access for you", and changed the welcome-list in the web.xml under ROOT/WEB-INF/


Another option would be to change the "path" attribute in your apps <Host> to be "/" and then rename the one that said "/" before to be "/oldroot" or delete it altogether!


This i don't get. Could you explain little bit more please
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, pretty much ignore anything I said in the post above.

What I think you need to do is to edit $TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml and remove the mapping of index.jsp

Then edit your own web.xml in /webapps/yourapp/WEB-INF and create a similar mapping, so you may want to map "/index.jsp" or just "/"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic