Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JSP Interest »

Re: JSP 2 / fn:replace Question

DIGEST Paul Knox

2004-04-13

Replies:

Eric,

problem is that you are not using the escape character, in java this is
the \.

so your line should be

<c:set var="test" value="${fn:replace(test,'\'','')}" />

Try that. It should work.



-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:JSP-INTEREST@(protected)
Sent: 13 April 2004 07:51
To: JSP-INTEREST@(protected)
Subject: JSP 2 / fn:replace Question


I am using tomcat 5.x/jstl 1.1. How do i replace a single quote with
blank using jstl 1.1, i tried the ff

<c:set var="test" value="${fn:replace(test,''','')}" />
${test}

but it errors

org.apache.jasper.JasperException: /test.jsp(12,0)
"${fn:replace(test,''','')}" contains invalid expression(s):
javax.servlet.jsp.el.ELException: Encountered "','", expected one of
[".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=",
"ne", ")", ",", "[", "+", "-", "*", "/", "div", "%", "mod", "and", "&&",
"or", "||", "?"]


Thanks for your help.

========================================================================
===
To unsubscribe: mailto listserv@(protected)
JSP-INTEREST". For digest: mailto listserv@(protected)
JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto listserv@(protected)".
For digest: mailto listserv@(protected)".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com
©2008 junlu.com - Jax Systems, LLC, U.S.A.