This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing html inside/outside servlet  RSS feed

 
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!