head.txt源码:
<table align="center" border="0" width="790" height="12" bgcolor="cyan" cellpadding="0">
<tr>
<td width="100%">
<a href="<%=response.encodeURL("showMenber.jsp")%>">浏览会员</a>|
<a href="<%=response.encodeURL("register.jsp")%>">会员注册</a>|
<a href="<%=response.encodeURL("login.jsp")%>">会员登录</a>|
<a href="<%=response.encodeURL("find.jsp")%>">查找会员</a>|
<a href="<%=response.encodeURL("message.jsp")%>">留言板</a>|
<a href="<%=response.encodeURL("publicMessage.jsp")%>">查看公共留言</a>|
<a href="<%=response.encodeURL("seretMessage.jsp")%>">查看私人留言</a>|
<a href="<%=response.encodeURL("modifyPassword.jsp")%>">修改密码</a>|
<a href="<%=response.encodeURL("modifyMessage.jsp")%>">修改个人信息</a>|
</td>
</tr></table>
JSP源码
[code=jsp]
<%@ page contenType="text/html language="java" import="java.util.*" charset="GBK" pageEncoding="UTF-8"%><%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.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">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body bgcolor=yellow>
<%@ include file="head.txt" %>
<h1>
<center>欢迎网上结交朋友</center>
</h1>
[/code]
为什么在MYECLIPSE里运行JSP后从head.txt包含进来的文字出现了乱码,怎么解决呢?
<table align="center" border="0" width="790" height="12" bgcolor="cyan" cellpadding="0">
<tr>
<td width="100%">
<a href="<%=response.encodeURL("showMenber.jsp")%>">浏览会员</a>|
<a href="<%=response.encodeURL("register.jsp")%>">会员注册</a>|
<a href="<%=response.encodeURL("login.jsp")%>">会员登录</a>|
<a href="<%=response.encodeURL("find.jsp")%>">查找会员</a>|
<a href="<%=response.encodeURL("message.jsp")%>">留言板</a>|
<a href="<%=response.encodeURL("publicMessage.jsp")%>">查看公共留言</a>|
<a href="<%=response.encodeURL("seretMessage.jsp")%>">查看私人留言</a>|
<a href="<%=response.encodeURL("modifyPassword.jsp")%>">修改密码</a>|
<a href="<%=response.encodeURL("modifyMessage.jsp")%>">修改个人信息</a>|
</td>
</tr></table>
JSP源码
[code=jsp]
<%@ page contenType="text/html language="java" import="java.util.*" charset="GBK" pageEncoding="UTF-8"%><%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.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">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body bgcolor=yellow>
<%@ include file="head.txt" %>
<h1>
<center>欢迎网上结交朋友</center>
</h1>
[/code]
为什么在MYECLIPSE里运行JSP后从head.txt包含进来的文字出现了乱码,怎么解决呢?
解决方案 »
- jsp里怎么注释表达式,用html,jsp方法注释编译都出错了
- 关于JSF应用部署到weblogic11g上的问题
- 求一条HQL查询语句,谢谢了!
- 我租了一个服务器 域名 怎么把写好的jsp网站部署到服务器上
- 请问这样的网站是用什么形式构成的?
- APACHE+TOMCAT直接域名访问的问题
- 继续求解操作Word经过封装的POI的下载网址......好急....帮忙.
- 能修改jar文件中的XML文件吗
- 还有那有可以让jsp连接mysql的jdbc驱动程序呀
- 关于jsp文件中的图片显示问题!(平台tomcat+apache)
- 用js,控制jsp页面body的onload只执行一次
- post传值到另外页面,另外页面获取不到值或者是post没有成功,请指导
如果不行 就用下面的看看<%@ page contenType="text/html;charset=UTF-8" language="java" import="java.util.*" pageEncoding="UTF-8"%>
加入这一句
囧写一样了 charset="UTF-8" pageEncoding="UTF-8"