This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I am building a dynamic page, that gets its html contents from the model object passed to jsp using ModelAndView type. The html content is passed to jsp but the html code gets displayed as it is on the page. Like if i pass "<table><tr><td>Hello!</td></tr></table", this string would display on the page but no actual table. I am using following code in the jsp page.
<c:forEach items="${model.criCellList}" var="cell"><c ut value="${cell.cellContents}" /> </c:forEach>
Can any one help?
Ansar Shah
Greenhorn
Joined: May 02, 2007
Posts: 29
posted
0
I have just seen that the compiled jsp page source is showing " < " in place of " < " in my dynamically generated html.
I dont know why this is happening.. Please help..
Ansar Shah
Greenhorn
Joined: May 02, 2007
Posts: 29
posted
0
Well ! its even working in the ranch page then why dont on my page. . I meant to say .
sruthi das
Ranch Hand
Joined: Dec 28, 2007
Posts: 34
posted
0
try like this for example this is in my controller. return new ModelAndView("View_printer_detail.jsp", "Model", persons); and in my jsp <c:forEach var="log1" items="${Model}"> <tr><td> <c ut value="${log1.printerid}" /> </td><td> <c ut value="${log1.ipaddress}" /> </td><td><c ut value="${log1.storeid}"/></td><td><c ut value="${log1.default1}"/></td></tr> </c:forEach>
Ansar Shah
Greenhorn
Joined: May 02, 2007
Posts: 29
posted
0
Thanks for the response. Infact I want even the columns and rows to be dynamic. Why the contents from the model object dont get compiled to a html page? Is there a way out?
Thanks.
sruthi das
Ranch Hand
Joined: Dec 28, 2007
Posts: 34
posted
0
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> did you import this taglibrary
Ansar Shah
Greenhorn
Joined: May 02, 2007
Posts: 29
posted
0
Yes I did, no problem with this tag library as the html content is getting to the page at least. Even when I copy the html code displayed on the page, and then paste it direct on the jsp page, then it works perfectly fine. But some how when it comes through server side, then it displays it as a text.