| 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 < for the less than (lt) sign, and > 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? <
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
< 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 <, with the trailing ;
|
SCJP 1.4 - SCJP 6 - SCWCD 5
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
|
 |
 |
|
|
subject: Problem in SOP
|
|
|