th:text expression doesn't evaluate json string when json object key is of single character length

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

th:text expression doesn't evaluate json string when json object key is of single character length

Babu
We are using thymeleaf expressions to evaluate the json data.We pass the json string in context and parse this render it.  
I have the following json passed in the context.
 
   DESIGN_JSON= {title={name=My Test Title, label={Default=Title}, type=Textbox, autoGenerated=false, value=}, d={name=d, label={Default=Description}, type=Textbox, autoGenerated=false, value=}}

thymeleaf expressions:

Below expression Works fine and displays object {name=My Test Title, label={Default=Title}, type=Textbox, autoGenerated=false, value=}

    <label name="t1" class="break-word" th:text="${DESIGN_JSON['title']}">title: </label>

But below expression doesn't work and displays blank

    <label name="Desc" class="break-word" th:text="${DESIGN_JSON['d']}">Desc: </label>

Could any one help me on this regard?