Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Escape Sequence problem

 
Raja Sagar Panamgipalli
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic