I found a problem with setting value in jsp. I have an element to be stored in database, if I provide its value with "phenom<name" In the database it saves as "phenom<name".but while displaying data to user text after "<" symbol gets truncated and it displays as "phenom<" instead of "phenom<name"
Asked
Active
Viewed 85 times
2
Tushar
- 82,599
- 19
- 151
- 169
Nizamuddin Shaikh
- 353
- 1
- 4
- 13
-
I found a problem with setting value in jsp. I have an element to be stored in database, if I provide its value with "phenom
– Nizamuddin Shaikh Apr 19 '16 at 06:57 -
If i add escape symbol "\" to "phenom – Nizamuddin Shaikh Apr 19 '16 at 07:01
-
``\`` is not an escape character in HTML, which is where you are experiencing the problem. – Quentin Apr 19 '16 at 07:29
1 Answers
1
You need to escape it..
<c:out value="phenom<name" />
or
${fn:escapeXml('phenom<name')}
or
"phenom<name"
Severino Lorilla Jr.
- 1,617
- 4
- 20
- 33