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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path Problem help needed !!!!!!

Status
Not open for further replies.

MarkShark

Programmer
Aug 22, 2001
36
US
I have a servlet that calls up an html etc. The nested page will not load and when I check servlet log is states the following:

2001-09-21 01:09:34 - path="" :jsp: init
2001-09-21 01:11:28 - path="" :LoginServlet: init
2001-09-21 01:11:54 - path="" :CourseServlet: init
2001-09-21 01:12:19 - path="" :LessonServlet: init
2001-09-21 01:12:28 - path="" :Error: /usr/local/apache/sites/tesco.spinweb.net/htdocs/cmi/courses\Food Service/Lesson01/AU01/AU01.html (No such file or directory)

The reason it can't find the html is due to "\" being there instead of "/"
I've checked my DB and all my script and it still comes up with the same error of not finding same. Below is a section of script that should replace any "\" with "/". Is there something I'm missing here:

private String getAUHtml (String path){
path = path.replace ('\\', '/');
String response;
response = &quot;<html>\n&quot; +
&quot;<head>\n&quot; +
&quot;</head>\n&quot; +
&quot;<body>\n&quot; +
&quot;<script language=\&quot;JavaScript\&quot;>\n&quot; +
&quot;document.location = \&quot;/cmi/courses/&quot; + path + &quot;\&quot;\n&quot; +
//&quot;win = window.open ('','displayWindow','menubar=yes,scrollbars=yes,status=yes,width=300,height=300');\n&quot; +
//&quot;window.onload = \&quot;win.close();\&quot;&quot; +
&quot;</script>\n&quot; +
&quot;</body>\n&quot; +
&quot;</html>\n&quot;;
return response;


Thanks in advance for any help anyone could provide me.
 
I am not sure if you can replace 2 chars with only one, you may find that you have to do your replace just like path.replace('\', '/') :cool:

 
Tried that and it did not compile, but thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top