Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

local page reference in a served page not working

Status
Not open for further replies.

81264760

Programmer
Jul 2, 2013
3
CA
I use a wiki served by Apache Tomcat as a PIM. Everything works well with one exception. Some of the wiki pages have a link that references a file in the local file system. This link does not work - if I click on it then nothing happens. However if I use the browser "view source" option and copy and paste the source into a plain text file (with .html extension) on the desktop and then double click on that file or drag and drop that file into a browser window it works as expected and displays he linked file. Why is that and how can I fix it?

I am running apache-tomcat-7.0.39 on a computer that is running Microsoft Windows XP
Professional Version 2002 Service Pack 3. This problem occurs when using either IE or Firefox.

I am using the following version of IE:

Internet Explorer
Version: 6.0.2900.5512.xpsp.080413-2111
Cipher Strength: 128-bit
Product ID: 76487-OEM-0027856-22922
Update Version:; SP3

I am using the following version of Firefox:

Mozilla Firefox
version 2.0.0.13

It seems to me that the only difference between the page served by Tomcat and the page that I create by copying the page source is that the former will have headers, so I installed Live HTTP Headers 0.17 in Firefox and used that to capture the header produced by Tomcat. The header is as follows:

===== header begin

GET /wiki/cgi-bin/wiki.cgi?ReferencePage20050125T1810 HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html
Content-Length: 2381
Date: Tue, 28 May 2013 02:50:05 GMT
===== header end
 
There's this little big thing called security. What you try to do sounds like it's not secure, and not allowed by tomcat by default [glasses]
 
You can try this for IE to test if it's a security thing. Anyway, does it really make sense to have a website pointing to a local file?

Cheers,
Dian
 
Security is not really an issue here since this PIM is hosted on a stand-alone computer that is not connected to any network.

If it is a security issue and is not allowed by Tomcat by default, is there any way to get Tomcat to allow this behaviour?

As a side issue, can anyone explain why referring to a local file on a server is insecure? (Yes, I have no experience with web servers except as a user.)
 
The security filter is not in Tomcat but in the browser.

First of all, could you paste the link for the local file? Is there any error, like a little yellow triangle in the bottom left corner? Take a look at this

Cheers,
Dian
 
The link to the local file in the served page looks like this:

<a href="file:///D:\path\file.htm">title</a>

Previously it did not have the "file:///" part, so I changed the wiki script to insert this string. This did not fix the problem.

I also tried replacing all of the backslashes in the URL shown above with forward slashes. This also did not fix the problem.

This problem occurs both with IE and Firefox, so it seems that this is not an IE-specific problem.
 
Good ideas here

Do you have your site in Trusted Sites? What error are you getting rigth now?

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top