This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML link

 
Bob Moranski
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a question about links to HTML in servlets. Do we just use directory like "c:/tomcat/login.html"? Or do we use links like "http://www.bob.com/login.html"?
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bob,
Apart from http,the link (href portion in <a> html tag) can be other protocols also like file/ftp/mailto. I just cut and paste few examples from one of the HTML references I have.
regds
maha anna

 
Bob Moranski
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you maha! If I have <a href=\"c:/tomcat/login.html\">click here</a>. Can a remote client get it? If they can, will it be displayed as c:/tomcat/login.html and show them my directory heirachy?
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to be very careful with the forward/backward slashes and use it appropriately. It may depend on read/write/execute permissions of the dir structure. If it has read permission for all the remote client can view the dir structure. Try it.
regds
maha anna
 
Sheldon Rego
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Attn Maha Anna,
this is with regards to the query that bob has put forth.
My question is: Can a user access the physical file residing on the server using an anchor tag.
For ex: <a href="c:\amit\a.html">a.html</a>
"C:\" is the local directory of the server.
Similarly can he access other drives of the server.If so how please reply...Thanks in advance...
 
prakash muthu
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
You can't refer any drive of the server. if you give as c:\ it will refer only the local machine.
with regards
Prakash
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic