必填字段
<div class="input-group">
<form:input type="text" class="form-control" name="username" id="username" path="username" placeholder="Enter Name" required />
</div>
</div>
<div class="form-group">
<div class="input-group">
<form:input type="email" class="form-control" id="email" name="email" path="email" placeholder="Enter Email" required/>
</div>
</div>
<div class="form-group">
<div class="input-group">
<form:input type="password" class="form-control" placeholder="Password" id="pass" path="pass" name="pass" required/>
</div>
</div>
<input type="submit" name="submit" id="submit" value="Submit" class="btn btn-info pull-right"/>
</div>
</form:form>
我收到错误:
org.apache.jasper.JasperException:/WEB-INF/jsp/register.jsp(line:60,column:149)等于符号预期 org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:275) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:91) org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:218) org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:163) org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:154) org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1231) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1455) org.apache.jasper.compiler.Parser.parseBody(Parser.java:1668) org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:996) org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1271) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1455) org.apache.jasper.compiler.Parser.parse(Parser.java:139) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227) org.apache.jasper.compiler.ParserController.parse(ParserController.java:100) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199) org.apache.jasper.compiler.Compiler.compile(Compiler.java:356) org.apache.jasper.compiler.Compiler.compile(Compiler.java:336) org.apache.jasper.compiler.Compiler.compile(Compiler.java:323) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
答案 0 :(得分:3)
替换
required
通过
required="required"
答案 1 :(得分:-2)
在jsp文件中,当我们包含enabled,required,readonly等属性时,应在标记内使用这些属性为enabled =&#34; enabled&#34; 需要=&#34;需&#34; ,readonly =&#34; readonly&#34;等
我使用相同的方法解决了类似的问题