Java 未终止&;书信电报;html:formtagjsp
我有个小问题。当我使用不带if条件的表单时Java 未终止&;书信电报;html:formtagjsp,java,jsp,Java,Jsp,我有个小问题。当我使用不带if条件的表单时 <html:form action="/customerDepositReport.doo?showCustDepsForPrintingReceipt_action=showCustDepsForPrintingReceipt"> 它工作得很好,但当我把它放在我的if-else中时 <% if(session.getAttribute("correctionEntry")!=null) { %>
<html:form action="/customerDepositReport.doo?showCustDepsForPrintingReceipt_action=showCustDepsForPrintingReceipt">
它工作得很好,但当我把它放在我的if-else中时
<% 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/custngmt/reports/viewCustomerDepositReportCriteriaForOldReceipt.jsp(356,0)未终止请立即终止标记,
使用后,将
导入jsp文件
您的错误清楚地表明,未终止(请参见)
意味着,在每个标记使用后,您需要关闭它 “我有,而且不管怎样,就像我说的,如果我不使用if-else,它可以很好地工作。”SyedMuhammadOan说得对,但是,在使用scriplet之前,您还没有包含body。但在使用if…else的时候,你们试图在身体里添加一些东西。。。所以这些部分需要保留在打开-关闭标签中。很好,我尝试了你所说的,你是对的,但现在还有另一个问题。我有if(条件){//form tag open whole body//form tag close}否则{//form tag open whole body//form tag close}我必须重复整个body两次,因为这样。你知道其他方法吗?@syedmuhammadon我可以知道if块和else块中的两个内容有什么区别吗?