• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Writing html inside/outside servlet

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, I see it now.
rick
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic