The below code throws an error in Netbeans saying the include statement is not closed. I’ve tried a few things like @%> and I’m not able to figure out what’s up. what am I doing wrong here?
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=request.getAttribute("title")%></title>
</head>
<body>
<%@include file=request.getAttribute("template")%>
</body>
</html>
Try using
<jsp:directive.include/>:Depending on the contents of your template,
<jsp:include/>may also work: