我把一个网页的头部作为一个banner.jsp  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>公安局局长信箱</title>
<link type="text/css" rel="stylesheet" href="style.css"></link>
<script src="/includes/aBase.js"></script>
<script language="javaScript" src="/includes/aEdit.js"></script>
</head>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" id="border_top">
<tr>
<td height="87"><img src="Images/001.gif" width="780" height="87" /></td>
</tr>
<tr>
<td height="7" background="Images/002.gif"></td>
</tr>
</table>是在eclipse中做的 问题在于这个banner.jsp不能保存 非要在首行写上<%@ page contentType="text/html;charset=utf-8" errorPage="/common/error.jsp"%>
可我看有的人没写这个也能保存  请问我该如何解决

解决方案 »

  1.   

    规范要求吧,你既然把它命名成jsp文件,那就加上那个头吧
      

  2.   

    如果没有网页代码 只是纯jsp代码是可以不要头标识符的
    否则必须加上
    因为网页代码已经不属于jsp内部内容了
      

  3.   

    <%@ page contentType="text/html;charset=utf-8" errorPage="/common/error.jsp"%> 是编码问题,如果不用eclipse写,可以省略,但最好要加上,给出一个合理的编码.要不回出现中文乱码问题
      

  4.   

    <%@ page contentType="text/html;charset=utf-8" errorPage="/common/error.jsp"%> 这个最好还是写上吧,要不会出现乱码问题
      

  5.   

    这个是java的规范 
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
      

  6.   


    agree with this idea!