标签:基础知识 java jsp java 代码
概述:基础知识还是比较薄弱啊,今天在做项目都有点不记得了,还是写下来以防万一吧
<%@ page import="java.io.IOException" %>
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 15-1-19
Time: 上午11:31
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
String header = (String)request.getAttribute("mpHeader");
String id = (String)request.getAttribute("id");
if(header.indexOf("MicroMessenger")==-1){//判断是否是微信浏览器
try {
response.sendRedirect("mp_ajax_vcf.html?id="+id);//如果是就异步跳转,如果不是就执行接下去
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
%>
<html>
<head>
<title>通讯录</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
</head>
<body style="background:url(<%=request.getContextPath()%>/images/weixintype.jpg) top right no-repeat rgba(0,0,0,.8);background-size: 290px;" >
//<%=request.getContextPath()%>获取项目根目录
</body>
</html>
本文出自 “小博客” 博客,请务必保留此出处http://9686567.blog.51cto.com/9676567/1605928
标签:基础知识 java jsp java 代码
原文地址:http://9686567.blog.51cto.com/9676567/1605928