不行,编译时要确定
可以通过response.setContentType("");来设定

解决方案 »

  1.   

    我写过这样的jsp:<%
      String saveType = request.getParameter("type");
    %><%@ page contentType="application/vnd.ms-<%=saveType%>;charset=GBK" %>
    ...结果是可以的
      

  2.   

    不可以,因为它是预编译的,也就是说在执行语法检查前就必须确定。
    但我们可以通过在编译过程中指定,用request.setCharacterEncoding("")来改变
      

  3.   

    jsp是预编译的
    所以
    如果要动态改变encoding
    一种方法是utf-8
    还有一种是servlet设定
    推荐你用utf-8
    一劳永逸又不加代码