I have 2 files.
– MyJsp.jsp
– MyJspFragment.jspf
MyJsp.jsp includes the fragment file. The syntax checker (MyEclipse 5.0 GA/Eclipse 3.2) gave me the
following error in the <%@ include file=”MyJspFragment.jspf”%> statement:
Multiple annotations found at this line:
– Syntax error on token “}”, { expected
– Syntax error, insert “Finally” to complete TryStatement
Here is my code:
FileName: MyJsp.jsp
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSF 'MyJsp.jsp' starting page</title>
</head>
<body>
<f:view>
<f:subview>
<%@ include file="MyJspFragment.jspf"%>
</f:subview>
</f:view>
</body>
</html>
FileName: MyJspFragment.jspf
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h:panelGrid width="100%">
<h:dataTable value="#{baseUserDto.alternateExtensions}" var="alternateExtension">
<h:column>
<f:facet name="header">
<h:outputText value="#{screen.number}" />
</f:facet>
<h:outputText value="#{alternateExtension.index}" />
<f:facet name="footer">
<h:panelGrid width="100%" cellspacing="1">
<h:outputText value=""></h:outputText>
</h:panelGrid>
</f:facet>
</h:column>
</h:dataTable>
</h:panelGrid>