• 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

Problem in SOP

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there!
I am trying to read the following line from a text file and print in on an HTML page in a J2EE app:

<applet code=Test.class age=33 width=100 height=100>

but I am not getting proper string output.
I want to print it as a string.
I have tried all possible escape sequences.
Is there any escape sequence for the ">" and "<" characters.

Please help.
Olly
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using &lt; for the less than (lt) sign, and &gt; for the greater than (gt) sign.

General hint: Search for "html escape."
 
Olly Ontario
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the hint Marc.
I'm on it. Will let you know Asap.

Rgds,
Olly
 
Olly Ontario
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well!
I tried <applet code=Test.class age=33 width=100 height=100>

but it printed <applet code=Test.class age=33 width=100 height=100>

dont know why < does not work and > works?

PLease help

Olly
 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you have "lt" between an ampersand and a semicolon?

&lt;
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
< marks the beginning of a new HTML element. If you try to print that line directly, it will get printed as an HTML applet element inside the HTML, not the string you want.

You need to use &lt;, with the trailing ;
 
Olly Ontario
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Awwww!
Opps!
Sorry! I wasnt using the trailing ;.
Thanks for all your help Marc & Rob.

Rgds,
Olly
 
reply
    Bookmark Topic Watch Topic
  • New Topic