Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create friendly URL in Apache tomcat

 
Foni kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to modify my application URL http://localhost:8080/monitor/index.html to just monitor , so that on putting monitor on browser, my application should open. Is there a way to achieve this, can someone suggest the configuration changes which will be required for this.

Thanks and regards
Deb
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what the <welcome-file-list> tag in your web.xml is for.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
index.html is already on the welcome list, so you don;t need to do anything to make that happen.
 
Foni kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:That's what the <welcome-file-list> tag in your web.xml is for.


Thanks for the reply but how can I shorten this URL link http://localhost:8080/monitor/index.html to a friednly url . Can you provide me some steps so that I will be clear about this approach?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assumed that by "friendly URL" you meant being able to use "http://localhost:8080/monitor/" instead of "http://localhost:8080/monitor/index.html". That's what <welcome-file-list> allows you to do, and a web search will quickly find more information about how to do that if you aren't familiar with it. If you meant something else, tell us what that is.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given:

http://localhost:8080/monitor/index.html

Setting the monitor webapp's web.xml "welcome-page" to index.html will reduce to:

http://localhost:8080/monitor

Setting the monitor webapp to run under the root context would reduce to:

http://localhost:8080

Setting Tomcat to listen to port 80 would reduce to

http://localhost

Although it would typically require running Tomcat as a privileged user.

Depending on your browser, you might get it to respond at when you type in "localhost".

You could put an entry in your system's "hosts" file to map www.monitor.com to 127.0.0.1 and thereby use "monitor" as a shortcut URL, providing that your system supports a "hosts" file and that the browser you use is one of the ones that takes a simplified domain name and expands it to add the "www" and ".com" parts.





 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic