1

I am using hibernate + spring MVC. In My project there is one column in table such as :

@Column(name = "CLM_DSCRIPTION")
private Text desc;

And getter & setter Method for this

    public Text getDesc() {
        return desc;
    }

    public void setDesc(Text desc) {
        this.desc = desc;
    }

now i used this table in jsp where i want to show this column data into table. M doing as below

<c:forEach items="${tbleObjs}" var="tbl" varStatus="status">
  <tr>
    <td>${status.index+1}</td>                              
    <td class="labels2">${tbl.desc}</td>
  </tr>
</c:forEach>

but it is not geting ${tbl.desc} here. if i did desc.getValue() then it will work but i don't know, which is the best way to achieve this.

Please suggest me a better way.

1 Answer 1

2

i have achieve with following code :

<c:forEach items="${entityObjs}" var="tbl" varStatus="status">
<tr>
  <%
   Entity entityObj = (Entity)pageContext.getAttribute("tbl");
   String disc =  project.getDesc().getValue();
   pageContext.setAttribute("disc",disc);
 %>
  <td>${status.index+1}</td>                                
  <td class="labels2">${disc}</td>
</tr> 
</c:forEach>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.