jsp base标签与meta标签学习小结
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:helloword
复制代码 代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<>
<%
String path = request.getContextPath();
//得到当前的项目名字。
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
//当前项目的基础url.
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<>
<base href="<%=basePath%>">
<>
<title>hello word</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>
</html>