include指令与include动作到底有什么区别
请看如下简单的代码:
代码1:(使用include 指令)
<%@ page contentType="text/html charset=gb2312" %>
<%@ include file="show_link.jsp" %>
编译时出现如下错误信息:org.apache.jasper.JasperException: /show_link.jsp(0,0) Page directive: can't have multiple occurrences of contentType
去掉第一行,编程成功。
代码2:(使用 include 动作)
<%@ page contentType="text/html charset=gb2312" %>
<jsp:include page="show_link.jsp" />
编译成功。
到底这两个include的用法有什么区别?为什么第一段代码有了
<%@ page contentType="text/html charset=gb2312" %>就报错?