• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to set Alias name for URL or change URL

 
Ranch Hand
Posts: 31
Hibernate Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi:

I am using Apache Tomcat as web server, it contains multiple web applications.
Url for one of this application is, e.g.http://localhost:8080/myapplication. This particular url work fine.
But i want to use only mypage word instead of all the above url.

So how to set or map this?


Thank You,
Balaji.
 
Saloon Keeper
Posts: 28315
207
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
URLs aren't "magic words". They are Uniform Resource Locators. In other words, the addresses of things. While you can apply a certain amount of aliasing, there are limits.

http: is the protocol name. It tells your browser to use the HTTP protocol, which is a text-based standard protocol.

'//' is a pathname component. It has to be "//' for web URLs, but it can be other things for other protocols. It indicates that the URL is an absolute URL, not a relative URL.

localhost is the name of the host that the request is going to be sent to. It can be an IP address, a local-domain (relative) hostname, or a fully-qualified domain name (FQDN). If a name is used instead of an IP address, the local computer's domain name resolutions mechanisms will be used to lookup the hostname and convert it to an IP address, since the browser has to know the destination IP address in order to send the request. Most browsers will attempt to resolve an unqualified domain name by addressing the "www" server, so for example, I can code "mousetech.com" and the browser will expand it to www,mousetech.com. Localhost is defined as IP address 127.0.0.1 and almost all OS's have it defined somewhere - usually in the "hosts" file.

8080 is the port. Almost every Internet protocol has a default/preferred port (or set of ports). For http, this port is 80, so the "8080" is an override and therefore not optional. DNS resolves ONLY IP addresses, not port numbers, so anything but port 80 MUST be explicitly declared.

myapplication is the name of the web application context that distinguishes one web application from another so that Tomcat will know whuch app the request will be fed to.

Any aliasing or URL-rewriting mechanisms must ultimately resolve to give all of the above information. Any information that isn't supplied will be inferred based on the client's current context. For example, I could specify a URL of "http:mypage" on a http://localhost:8080/myapplication page, and the browser would expand this to http://localhost:8080/myapplication/mypage. However, the browser navigation bar won't have that context, and the browser will typically attempt to expand a "mypage" URL into "http://www.mypage:80/". Unless it gets cute and just decides that's a search request and routes it to bing, google, yahoo, or whoever.
 
Yeah, but is it art? What do you think tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic