Hi,

I am using the fn:replace function in one of my JSPs and am having problems getting 
the newline characters in the string to be replaced.

If I use the following:

    ${fn:replace(requestScope.myobject.mystring, "\n", "<br><br>")}

I get the following exception:

org.apache.jasper.JasperException: /WEB-INF/jsp/MyJsp.jsp(131,14) 
"${fn:replace(requestScope.myobject.mystring, "\n", "

")}" contains invalid expression(s): javax.servlet.jsp.el.ELException: Encountered 
""\n", expected one of [, , , "true", "false", "null", "(", "-", "not", "!", "empty", ]
        
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)


I copied the replace function from the source code into a test app and tried passing a 
"\n" character to be replaced and it worked fine, so there is nothing wrong with the 
replace function.

Any ideas anyone?

Regards,

--Frank

Reply via email to