aspose file tools*
The moose likes Beginning Java and the fly likes Problem in SOP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem in SOP" Watch "Problem in SOP" New topic
Author

Problem in SOP

Olly Ontario
Greenhorn

Joined: Mar 17, 2008
Posts: 18
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
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Try using &lt; for the less than (lt) sign, and &gt; for the greater than (gt) sign.

General hint: Search for "html escape."


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Olly Ontario
Greenhorn

Joined: Mar 17, 2008
Posts: 18
Thanks for the hint Marc.
I'm on it. Will let you know Asap.

Rgds,
Olly
Olly Ontario
Greenhorn

Joined: Mar 17, 2008
Posts: 18
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

Joined: Aug 31, 2004
Posts: 11343

Are you sure you have "lt" between an ampersand and a semicolon?

&lt;
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19719
    
  20

< 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 ;


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Olly Ontario
Greenhorn

Joined: Mar 17, 2008
Posts: 18
Awwww!
Opps!
Sorry! I wasnt using the trailing ;.
Thanks for all your help Marc & Rob.

Rgds,
Olly
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in SOP