这么用应该是没错误的,但是你写错了,少了一个分号,应该是这么写
<%@ page contentType="text/html;charset=gb2312"%>

解决方案 »

  1.   

    这么用应该是没错误的,但是你写错了,少了一个分号,应该是这么写
    <%@ page contentType="text/html;charset=gb2312"%>
      

  2.   

    指令是把嵌入页面的内容都拿到主页面里面编译,
    而动作是指他自身编译后再放到里面去。
    下面是测试:
    a.jsp
    <%
    String s="afa";
    %>
    b.jsp
    <%
    String s="aaaf";
    %>
    如果用指令就会提示变量重复,
    如果用动作就能编译通过.
      

  3.   

    但为什么
    <%@ 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
      

  4.   

    那是你在show_link.jsp 中也有<%@ page contentType="text/html charset=gb2312" %>
    重复了,所以报错。