未终止的< html:表单标记JSP

时间:2016-03-28 12:43:10

标签: java jsp

我有一个小问题。当我使用表格时没有像

这样的条件
    <html:form  action="/customerDepositReport.doo?showCustDepsForPrintingReceipt_action=showCustDepsForPrintingReceipt">   

它工作正常,但当我把它包含在我的if else like

<% if(session.getAttribute("correctionEntry")!=null) { %>            
  <html:form  action="/preEntryCorrection.doo?entryCorrection_action=entryCorrection">              
  <input type="hidden" name="showDepositsList" value="">
  <% }else{ %>
    <html:form  action="/customerDepositReport.doo?showCustDepsForPrintingReceipt_action=showCustDepsForPrintingReceipt">   
<% } %>

它给了我一个例外:

  

org.apache.jasper.JasperException:/jsp/custmngmt/reports/viewCustomerDepositReportCriteriaForOldReceipt.jsp(356,0)未终止&lt; html:表格标签       org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)       org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)       org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:132)       org.apache.jasper.compiler.Parser.parseBody(Parser.java:1646)       org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:976)       org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1247)       org.apache.jasper.compiler.Parser.parseElements(Parser.java:1421)       org.apache.jasper.compiler.Parser.parse(Parser.java:130)       org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)       org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)       org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:194)       org.apache.jasper.compiler.Compiler.compile(Compiler.java:360)       org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)       org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)       org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:607)       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)       javax.servlet.http.HttpServlet.service(HttpServlet.java:847)       org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1833)       org.apache.struts.action.ActionServlet.process(ActionServlet.java:1670)       org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:514)       javax.servlet.http.HttpServlet.service(HttpServlet.java:754)       javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

我已经测试了这个条件,它确实输入了if部分,但在浏览表单标签时会导致异常。我不明白。请帮忙。

1 个答案:

答案 0 :(得分:1)

请大声终止标签,

</html:form>使用后,

<html:form> 进入您的jsp文件

你的错误清楚地说,未终止(见它)

表示在使用后需要关闭每个标记 (here <html:form>)