• Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing html inside/outside servlet

 
Rick Prevett
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I write a html page, I use

If I want to write the same line using out.println, I end up with this

I don't understand how the quotes and slashes are interpreted by the compiler to come up with the same output. What is the rule on the the slashes?
Anybody understand my question?
rick
[ May 25, 2002: Message edited by: Rick Prevett ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the " has a special meaning in Java code, namely starting or terminating a String literal, you have to use the \ - called an escape character - to prevent Java from using the usual meaning and instead inserting a literal " character.
Any basic Java text will discuss the various special characters that must be escaped.
Bill
 
Rick Prevett
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply, I see it now.
rick
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!