Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using a "less than" symbol in an expression .....  RSS feed

 
Roger Graff
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed that if I create a String containing a '<', any characters proceeding the it are omitted.
JSP Example:

The output is "Test = abc".
It seems to work if I use the ascii code "& # 60 ;" (omit the spaces) in place of '<'.

The output is "Test = abc<efg".
Can anyone explain this behavior?
-Graff
[ April 14, 2003: Message edited by: Roger Graff ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a JSP issue at all; if you do a "view source" of the page you are sending to the browser, you will see that all the string is there. The problem is that "<" is a reserved markup character and is confusing the browser. As you have discovered, the proper way to emit a reserved character on an HTML page is via an entity reference (although & lt ; is more common for the less than character).
hth,
bear
[ April 14, 2003: Message edited by: Bear Bibeault ]
 
Roger Graff
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<---- hitting head on desk :roll:
Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!