我在页面中加入了thymelef的th:value属性,然后我的页面就不显示了
<form th:action="@{/update.do}" method="post" th:object="${fruit}">
<input type="hidden" name="fid" value="0">
<table id="tbl_fruit" >
<tr>
<th class="w20">名称:</th>
<td>
<input type="text" th:value="*{fname}" name="fname" />
</td>
</tr>
<tr>
<th class="w20">单价:</th>
<td>
<input type="text" th:value="*{price}" name="price" />
</td>
</tr>
<tr>
<th class="w20">库存:</th>
<td>
<input type="text" th:value="*{fcount}" name="fcount" />
</td>
<tr>
<tr>
<th class="w20">备注:</th>
<td>
<input type="text" th:value="*{remark}" name="remark" />
</td>
<tr>
<th colspan="2">
<input type="submit" value="修改" />
</th>
</tr>
</table>
</form>
但是我的后台已经提交了数据了
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
FruitDAO dao=new FruitDAOImpl();
String fidStr = request.getParameter("fid");
if (StringUtils.isNotEmpty(fidStr)){
int fid=Integer.parseInt(fidStr);
Fruit fruit = dao.Query(fid);
HttpSession session = request.getSession();
session.setAttribute("fruit",fruit);
super.processTemplate("edit",request,response);
}
}
但是我的结果就是这样的