Why i get error when use spring input tag

时间:2019-04-08 13:28:56

标签: java spring jsp

Whenever i use s:input i get org.apache.jasper.JasperException, i don't know why this doesn't work. Here is my code:

<c:forEach var="msg" items="${listMonAn}">
   <s:form action="XuLyThemMon.htm" commandName="chitietdon" method="get" modelAttribute="chitietdon">
      <!--                                        <li><a href="#">-->
      <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6" style="margin-top: 38px;">
         <img src="
         <c:url value="/resource/images/${msg.getMon_hinhAnh()}"/>
         " style="border-radius: 20px;"><br><br>
         <s:input path="name" value="name"></s:input>
         <input type="submit" value="Đặt món" class="btn btn-info"/>
      </div>
      <!--                                            </a></li>-->
   </s:form>
</c:forEach>

There code use http://www.springframework.org/tags/form

1 个答案:

答案 0 :(得分:0)

哦,我解决了这个问题,我只是创建了一个bean并在其中导入数据:

@ModelAttribute("chitietdon")
    public ChiTietDon getThongTinBan(){
        return new ChiTietDon();
    }