标准的jsp文件头

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
<head>
  <base href="<%=basePath%>">
   
  <title>My JSP 'register.jsp' starting page</title>
   
  <meta http-equiv="pragma" content="no-cache">
  <meta http-equiv="cache-control" content="no-cache">
  <meta http-equiv="expires" content="0">   
  <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  <meta http-equiv="description" content="This is my page"> 

.......

........

.......

......

</head>

<body>

</body>

 

其中红色部分<!DOCTYPE HTML>很重要,必须写而且只能这么写,否则某些浏览器不支持,可能会异常显示。html文件也得加这个。

你可能感兴趣的:(jsp)