• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Questions about real world

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hola ranchers.
I just want to ask questions about the real world (novice questions).
1. in our machines we use the following:
http://localhost:8080/mycontext/store/addtosc
(/store/addtosc is url mapping for a servlet).
what approach that is used in the real sites:
<a href="/mycontext/store/addtosc">
<a href="http://localhost:8080/mycontext/store/addtosc">
2. in real sites, we write:
http://www.mydomain.com/index.jsp
where is the context?
(I mean why we don't write www.mydomain.com/context/index.jsp
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason you don't often see an explicit application context named on large commercial servers is that they typically only run one application on each domain. If you are expecting lots of traffic, it often makes sense not to share the server with other applications.
Servlet containers recognize a special context (known as "ROOT") which is used if no context name is supplied in the URL. This is commonly used when only a single application is needed, to simplify the client URLs.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another common way to hide the context is to use a web server to redirect requests to the application server, and allow the web server to map requests to the application server context.
Therefore requests to the web server on 'www.mydomain.com/*' will result in requests to '/mydomain/*' on the app server.
There are various reasons to do this.A single web server can manage several domains as 'virtual hosts' then treat these differently. It can also allow you to set up rules in the web server to serve static content before redirecting other requests to the application server. You can also encrypt the internal traffic for security, allow the web server to manage external encryption, put the web server in a 'demilitarised zone' to improve security.
 
reply
    Bookmark Topic Watch Topic
  • New Topic