Hi Experts,
Requirement is to replace the \\n in text value of bean-variable to \n. There is a method written in Tag which does the replacement for me. See below
/**
* replace in a string the old string with a new string
* @param value - whole string
* @param oldString - old string, which will be replace
* @param newString - new string
* @return the whole new string
*/
public static String replaceTitle(String value, String oldString, String newString ) {
value = value.replace(oldString,ne
wString);
return value;
}
I call this method from the JSP page as below.
<textarea class="disable" disabled>${tag:replaceTitl
e(contact.
text,"\\n"
,"\n")}</t
extarea>
Value of "contact.text " is = "some title \\n second line"
Text area in the browser displayes following text
"some title n second line"
What should I change in the JSP code so that slash (\) stays preserved.
Best Regards