aspose file tools*
The moose likes Servlets and the fly likes Escape Sequence problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Escape Sequence problem" Watch "Escape Sequence problem" New topic
Author

Escape Sequence problem

Raja Sagar Panamgipalli
Ranch Hand

Joined: Aug 13, 2003
Posts: 109
Hi All,
i'm having a problem with compilation at this statement....can anyone plz explain how to go about resolving such errors.



ShoppingCart.java:41: illegal escape character out.println("<hr><p><a href='\cart\servlet\catalog\'>back to homepage
</a></p>");
^
ShoppingCart.java:41: illegal escape character out.println("<hr><p><a href='\cart\servlet\catalog\'>back to homepage
</a></p>");
^
ShoppingCart.java:41: illegal escape character out.println("<hr><p><a href='\cart\servlet\catalog\'>back to homepage
</a></p>");

thank you so much....

Sagar


SCJP 1.4<br />SCBCD 1.3
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

URLs use forward slashes not back slashes



That should take care of it.

BTW: If you ever do need to put a backslash in a string, just escape it with another backslash

Example:
[ April 24, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Escape Sequence problem