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 92 times
2

Tushar
- 85,780
- 21
- 159
- 179

Nizamuddin Shaikh
- 383
- 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<\name" then it will display properly but it will also store with escape symbol in DB which is not appropriate. – 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,637
- 4
- 20
- 33