橘子你个哦润栀* 2022-12-04 09:29 采纳率: 0%
浏览 11

我在页面中添加了thymelef后页面不显示

 我在页面中加入了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);
        }

    }

但是我的结果就是这样的

img

  • 写回答

2条回答 默认 最新

  • 夜郎king 2022博客之星IT其它领域TOP 12 2022-12-04 10:53
    关注

    1、后台有错吗?
    2、fruit确定有值吧?

    评论

报告相同问题?

问题事件

  • 创建了问题 12月4日

悬赏问题

  • ¥15 有关类的报错,在模块里调用另一个模块的方法下的变量时出错
  • ¥15 delphi7 HMAC_SHA256方式加密
  • ¥15 关于#qt#的问题:我想实现qcustomplot完成坐标轴
  • ¥15 下列c语言代码为何输出了多余的空格
  • ¥15 kali linux用wget archive.kali.org/archive-key.asc指令下载签名无效(失败)
  • ¥15 openHarmony 利用c++程序在dayu210开发板上实现拉取RTSP视频流并且在屏幕上显示
  • ¥15 GD32H757的can通信配置
  • ¥20 nist随机数测试的问题
  • ¥20 帮我解决这个项目,thank you各位程序员
  • ¥15 哪位能用ea软件做一下,有偿