繁体   English   中英

在我的jsp页面上包含jsp文件时出错

[英]Error when including jsp files on my jsp page

我试图在我的JSP页面中包含2个JSP文件。 我的主页称为temp.jsp,它位于我的Web项目tempFolder的子文件夹中。 我试图在主项目文件夹中包含一个文件(称为invalidcqs.jsp),并在主项目文件夹的子文件夹(envmon)中包含一个文件(称为env_status_report.jsp)。

我的temp.jsp文件中的代码是:

<html>
  <head>
    <title>Screen1 using includes</title>
    <meta http-equiv="refresh" content="10"/>
  </head>
  <body style="background-color:#E6E6FA">
  <%@ include file="../envmon/env_status_report.jsp" %>
    <br><hr><br>
    <%@ include file="../invalidcqs.jsp" %>
  </body>
</html

第二个include <%@ include file="../invalidcqs.jsp" %>工作正常,但第一个<%@ include file="/../envmon/env_status_report.jsp" %>显示Eclipse中的错误。

错误文本为:

 Multiple annotations found at this line: - Syntax error on token "else", delete this token - Syntax error, insert "Finally" to complete TryStatement - Syntax error on token "else", delete this token 

有谁知道为什么Eclipse不喜欢这样?

通常,我不太关心jsp页面上的Eclipse报告错误,特别是在使用<%@ include>指令时。 例如,如果您在主页中声明scriptlet变量并在包含的页面中使用它,则Eclipse将抱怨在包含的页面中未声明它,但是它将在运行时正常工作。

该错误可能是从所包含的jsp中发出的,因此我将开始在其中查找此错误。

您也可以尝试以EL方式包含页面: <jsp:include page="/WEB-INF/pages/received.shtml" />也许会有所帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM