pdanese
asked on
specifying a hyperlink to a network path via java/jsp
Hi, I’m using Tomcat 5.5/Java 5.0. and Windows 2000 and Internet Explorer 6
I have a network path specified in a MySQL database table (e.g. \\Rpfs01\Department\Financ e\Public\R equisition s 4000+\req 4005 Sigma.xls)
I’d like to query this database table and display the results in an HTML table with the above path to be used as a hyperlink (i.e. the user clicks on the hyperlink and up pops a 2nd page containing the xls file specified by the path).
the problem is that web-page is viewing the path as containing escape characters. (i.e. if I click on the link as specified above, I get a file not found error. But if I add extra backslashes directly to the html code, the link works fine [e.g. \\\\Rpfs01\\Department\\Fi nance\\Pub lic\\Requi sitions 4000+\\req 4005 Sigma.xls]).
Is there a way to have java automatically add the required back-slashes to make this work? I tried replaceAll (i.e. myPathString.replaceAll(“\ \”, “\\\\”) ) but this is giving me a PatternSyntaxException.
Any suggestions on how to fix?
Thanks!
I have a network path specified in a MySQL database table (e.g. \\Rpfs01\Department\Financ
I’d like to query this database table and display the results in an HTML table with the above path to be used as a hyperlink (i.e. the user clicks on the hyperlink and up pops a 2nd page containing the xls file specified by the path).
the problem is that web-page is viewing the path as containing escape characters. (i.e. if I click on the link as specified above, I get a file not found error. But if I add extra backslashes directly to the html code, the link works fine [e.g. \\\\Rpfs01\\Department\\Fi
Is there a way to have java automatically add the required back-slashes to make this work? I tried replaceAll (i.e. myPathString.replaceAll(“\
Any suggestions on how to fix?
Thanks!
They don't need to be doubled
ASKER
??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> ??
/Rpfs01/Department/Finance /Public/Re quisitions 4000+/req 4005 Sigma.xls
/Rpfs01/Department/Finance
ASKER
this doens't work: <a href="javascript:popUp('\\ Rpfs01\Dep artment\Fi nance\Publ ic\Requisi tions 4000+\req 4005 Sigma.xls')">
this does: <a href="javascript:popUp('\\ \\Rpfs01\\ Department \\Finance\ \Public\\R equisition s 4000+\\req 4005 Sigma.xls')">
this does: <a href="javascript:popUp('\\
Did you try forward slashes btw?
Converting the one to the other is like CEHJ posted
I thiks this does too:
<a href="javascript:popUp('/R pfs01/Depa rtment/Fin ance/Publi c/Requisit ions 4000+/req 4005 Sigma.xls')">
<a href="javascript:popUp('/R
:-)
hi,
did you try this myPathString.replaceAll(“\ ”, “\\”) ??
DP
did you try this myPathString.replaceAll(“\
DP
Better work with forward slashes