spring - Error while getting JSON when data has spaces -


i facing issue while fetching json data when data has white spaces .

i using spring, in spring controller doing below,

string json=new gson().tojson(agents, new typetoken>() { }.gettype())

i able see proper json in logger too, after setting model attribute below one

model.addattribute("json",json);

here model 'org.springframework.ui.modelmap'

in jsp able fetching data till no space found.

example :

original json string: ilove java

fetching string in jsp: ilove

only please me out out using encoding string.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -