Yaseer Hussain
Yaseer Hussain

Reputation: 115

href links to open network shared files are not working with tomcat V-9.0.27 in linux

I have a simple JSP page that retrieves network location and users will access the network files, using href file link that work in local tomcat but the same link does not work from a Linux server's tomcat.

below code works in local windows tomcat to open a shared server file.

<A href="\\\\server\folder1\folder2\Master20-%20Ref.dwg" target=_blank>Master -Ref.dwg</A>

when this is deployed in the Linux server's tomcat the links do not work, my tomcat version is 9.0.27.

Upvotes: 1

Views: 225

Answers (1)

Piotr P. Karwasz
Piotr P. Karwasz

Reputation: 16185

The value of the href attribute should be an absolute URL or an URI path relative to the current page.

In your case you need to use absolute URLs. There is an almost standard URI scheme smb (cf. its Internet Draft) that works on Linux clients, but not on Windows clients.

For Windows clients you should probably use a non-standard application of the file scheme (cf. Wikipedia), which works on Windows clients. You should format your links in one of two formats:

<a href="file://server/share/folder1/folder2/Master20-%20Ref.dwg">Master -Ref.dwg</a>

or

<a href="file:////server/share/folder1/folder2/Master20-%20Ref.dwg">Master -Ref.dwg</a>

Edit: Following OP's comment, this should work the best:

<a href="file:////server\share\folder1\folder2\Master20-%20Ref.dwg">Master -Ref.dwg</a>

Upvotes: 1

Related Questions