Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

using replaceAll() function with jstl

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi All

I am passing values from a child window to parent window.
The child window has the following link on clinking of which the corresponding value pass to the parent window:



The argument in the closewindow() function passes to the parent window's text box.
My problem comes when ${stone.code} contains the apostrophe in it.
The java script gives the err as we know we should replace all occurances of
' with \' .
But i am unable to do this in with the jstl.
I have already spent a lot of time on it.
Please help me if any body has any idea.
Thanks a lot of you people in advance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
You can use the fn library's replace function. Here is a sample, look at the JSTL spec for more info about this function.

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks for your reply Sir

But my problem is i am declaring a parameter with c aram tag.
like :

<c aram name="catchphrase" value="${fn:replace(catchphrase, "'", "\\'")}" />

But this gives the compilation problem in jsp in value field as wen can see
" is ends when i write replace function.
So any body has any idea.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is similar to your other post, so I'm going to close this one so any discussion can take place in the original.

Also, please be sure that you check the disable smilies checkbox when posting code.
 
    Bookmark Topic Watch Topic
  • New Topic