• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to display text in angular brackets in jsp

 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to display some text within angular brackets in jsp.Even in simple html file if i write >bfasd>fsdf,it is displaying only fsdl and not text in angular brackets.Seems like issue with browser.

So,can anyone tell me how i can display text in angular brackets in browser or jsp file.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly the same as in HTML (which is what the JSP generates, as you know). Escape the > character as >.

(This is assuming you are just asking about hard-coded text in the JSP. You weren't very specific about where the text was coming from.)
[ November 04, 2008: Message edited by: Paul Clapham ]
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right.We can use > but in that case, even html tags will not work as expected and will come as it is.I mean writing <b> will not act as tag which makes text bold.
Can you suggest any other way.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is text that you want to be displayed with the brackets, and text that are real HTML tags. Only convert the former.
 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Edit: Thread hijack removed. Please see your private messages.]
[ November 04, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For dynamic text, the use of <cut> to emit the text automatically HTML-encodes the text. For template text, just type in the HTML entities yourself.
 
N Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Edit: please follow instructions and start your own thread for your issue]
[ November 04, 2008: Message edited by: Bear Bibeault ]
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not able to display : <b><xyz></b>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what that means. Are you using <cut> as instructed?

The escapeXml attribute of <cut> can be set to either escape the characters or not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!