• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tomcat4.1 : relative and absolute paths

 
Ranch Hand
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently working on tomcat4.1.
And it looks like that there is no difference in Absolute and relative path.
It does not matter whether I am using href="myPage01.html" or href="/myPage01.html".
Both points to "myContext/myPage01.html".
Though the calling/source page[where this link is available] is in myContext/dir01/dir02/callingPage.html.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Relative URL's are interpreted by the browser (not Tomcat or whatever other servlet container you are using) and will be relative to the current URL and not to the file system location where the page is located (which the browser hasn't got a clue about).
So what's the URL of the page in which you have the "misbehaving" links?
bear
 
R K Singh
Ranch Hand
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:
Relative URL's are interpreted by the browser (not Tomcat or whatever other servlet container you are using) and will be relative to the current URL and not to the file system location where the page is located (which the browser hasn't got a clue about).
So what's the URL of the page in which you have the "misbehaving" links?
bear


Looks like you are correct.
But then how come if you use URL like href="/somePage.jsp" is refered to <a href="http://myserver.com/<b rel="nofollow">myContext</b>/somePage.jsp" target="_blank">http://myserver.com/myContext/somePage.jsp
Before servlets 2.3, if you are refering like href="/somePage.jsp" then it will refer to http://myserver.com/somePage
Thanks in advance
 
R K Singh
Ranch Hand
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think, as my jsp are inside WEB-INF directory that why this problem is coming.
The jsp which are outside WEB-INF are working fine.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic