Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Escaping in JSP-Documents

 
Oliver Rensen
Ranch Hand
Posts: 109
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,

during my SCWCD-studies I have learned the following:

It is not allowed to use < in JSP-Documents. < must be escaped with
'& l t ;' in XML-pages (without the blanks):

WRONG:
<jsp:scriptlet> boolean b =
application.getIntHeader("counter") < 100;
</jsp:scriptlet>

CORRECT:
<jsp:scriptlet> boolean b =
application.getIntHeader("counter") & l t ; 100;
</jsp:scriptlet>

But I'm not sure whether I can use > in JSP-Documents or not.

Do I must escape > with '& g t ;' as well (without the blanks)?

Regards
Oliver
[ January 04, 2008: Message edited by: Oliver Rensen ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, > must be escaped.

You can also choose to use CDATA:
 
Oliver Rensen
Ranch Hand
Posts: 109
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marc, thank you for the reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic