File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Javascript escape characters in a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Javascript escape characters in a JSP" Watch "Javascript escape characters in a JSP" New topic
Author

Javascript escape characters in a JSP

Victor Dolirio
Ranch Hand

Joined: Aug 21, 2008
Posts: 57
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..


If happen something bad in you life, don't ask God why it happened. Ask for what.
SCJP 5 (80%) - SCWCD 5 (91%) - SCBCD & SCJD coming soon...
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

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.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Victor Dolirio
Ranch Hand

Joined: Aug 21, 2008
Posts: 57
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

Joined: Jan 10, 2002
Posts: 61413
    
  67

Nothing standard exists, but it's easy to write an EL function that will do this for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Victor Dolirio
Ranch Hand

Joined: Aug 21, 2008
Posts: 57
ok... thanks all.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript escape characters in a JSP