Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript escape characters in a JSP

 
Victor Dolirio
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

There are some EL function or custom tag in a any library that process javascript escape characters?

I´ve a troubled jsp code like this:



but the "someAttribute" is evaluated to a string like this: "joana d'arc".

If someone knows a already working function or custom tag please tell me.

Thanks in advance..
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not very sure of the libraries which would take care of removing the special characters. I guess we may have to adjust it manually. Try surrounding the variable name with double quotes. - I think it may solve.
 
Victor Dolirio
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, if there aren´t any library I´ll make this manually, but I don´t want to reinvent the wheel and want to keep patterns on code...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing standard exists, but it's easy to write an EL function that will do this for you.
 
Victor Dolirio
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok... thanks all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic