缺少“表单:输入”的结束标记

时间:2016-09-15 10:14:32

标签: java spring jsp

我在以下jsp页面的第一行有错误

<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
    <%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
    <html>
    <head>
    <meta http-equiv="Content-Type"
        content="text/html; charset=ISO-8859-
    1">
    <link rel="stylesheet"
        href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/boo
    tstrap.min.css">
    <title>Products</title>
    </head>
    <body>
        <section>
            <div class="jumbotron">
                <div class="container">
                    <h1>Products</h1>
                    <p>Add products</p>
                </div>
            </div>
        </section>
        <section class="container">
            <form:form modelAttribute="newProduct" class="form-horizontal">
                <fieldset>
                    <legend>Add new product</legend>
                    <div class="form-group">
                        <label class="control-label col-lg-2 col-lg-2" for="productId">Product
                            Id</label>
                        <div class="col-lg-10">
                            <form:input id="productId" path="productId" type="text"
                                class="form:input-large" />
                        </div>
                    </div>
                    <!-- Similarly bind <form:input> tag for
    name,unitPrice,manufacturer,category,unitsInStock and unitsInOrder
    fields-->
                    <div class="form-group">
                        <label class="control-label col-lg-2" for="description">Description</label>
                        <div class="col-lg-10">form:textarea id="description"
                            path="description" rows = "2"/></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-lg-2" for="discontinued">Discontinued</label>
                        <div class="col-lg-10">
                            <form:checkbox id="discontinued" path="discontinued" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-lg-2" for="condition">Condition</label>
                        <div class="col-lg-10">
                            <form:radiobutton path="condition" value="New" />
                            New
                            <form:radiobutton path="condition" value="Old" />
                            Old
                            <form:radiobutton path="condition" value="Refurbished" />
                            Refurbished
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
                            <input type="submit" id="btnAdd" class="btn btn-primary"
                                value="Add" />
                        </div>
                    </div>
                </fieldset>
            </form:form>
        </section>
    </body>
    </html>

在执行此操作时jsp我收到了错误,我是新手查看部分并且对Jstl el几乎没有任何了解但是在学习弹簧时我遇到了这个错误,其中说

  

在此行找到多个注释:

> - Missing end tag for 
> "form:input"
>- Missing end tag for 
> "form:input"

我错过了什么,怎么解决这个问题?即使是一个小小的提示也受到欢迎

由于

1 个答案:

答案 0 :(得分:3)

el还会评估评论中的表达式,因此您必须在评论中制作标签,因为它在&#34;正常&#34;页

更改

<!-- Similarly bind <form:input> tag for
    name,unitPrice,manufacturer,category,unitsInStock and unitsInOrder
    fields-->

<!-- Similarly bind <form:input/> tag for
name,unitPrice,manufacturer,category,unitsInStock and unitsInOrder
fields-->