首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

在线急等!求大侠解决。关于jsp在线连接网下的页面乱码有关问题

2012-07-16 
在线急等!!!求大侠解决。关于jsp在线连接网上的页面乱码问题%@ page languagejavaimportjava.util.*,

在线急等!!!求大侠解决。关于jsp在线连接网上的页面乱码问题
<%@ page language="java"
import="java.util.*,edu.jmi.SharePlatForm.bean.*,edu.jmi.SharePlatForm.dao.*,java.sql.*"
contentType="text/html; charset=utf-8"%>

<%
response.setHeader("Cache-Control", "no-store"); //HTTP 1.1
response.setHeader("Pragma", "no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
%>

<title>浏览贴子</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="skin/css/base.css">
<LINK href="css/bbs.css" type="text/css" rel="stylesheet">
<LINK href="css/view.css" type="text/css" rel="stylesheet">
<LINK href="css/foot.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
  window.onload = function(){
var tables = document.getElementsByTagName('table');
for(var i=0; i<tables.length; i++){
<!-- 弹出层开始 -->
<div id="light" class="white_content">
<div class="close">
<a href="javascript:void(0)" onclick="hide('light')"> 关闭</a>
</div>
<div class="con">
<table class="datagrid1">
<tr>
<th>
编号
</th>
<th>
相关解释
</th>
<th width="80">
资料来源
</th>
</tr>
<%
ToolsTOString t = new ToolsTOString();
try {
String s = MyThreadPool
.getStringByPath("http://so.csdn.net/search?q="
+ topic.getTopicTitle()
+ "&sort=&rt=h&t=thread");
String[] urlTitle = t.getUrlTitle(s);
int i = 0;
for (String r : urlTitle) {
i++;
%>
<tr>
<td><%=i%>.
</td>
<td><%=r%></td>
<td width="80">
<a href="http://www.csdn.net" target="_blank">CSDN论坛</a>
</td>
</tr>
<%
}
} catch (Exception e) {
e.printStackTrace();
}
%>

<tr height="30">
<td>
&nbsp;
</td>
<td align="center">
<a
href="http://so.csdn.net/search?q=<%=topic.getTopicTitle()%>&sort=&rt=h&t=thread"
target="_blank">查看更多关于"<%=topic.getTopicTitle()%>"的资料...</a>
</td>
<td width="80">
&nbsp;
</td>
</tr>
</table>
</div>
</div>
<div id="fade" class="black_overlay"></div>
<!-- 弹出层结束 -->

<div id="main">
<%@include file="head.jsp"%>
<div
style="height: 90px; width: 950px; position: relative; padding-left: 10px; height: 24px; line-height: 24px; background: #EDF3FD">


主题:<%=topic.getTopicTitle()%>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;回帖数:<%=replydao.findCountReply(topicId)%>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="javascript:void(0)" onclick="show('light')"><font
color='blue'>更多回答?</font>
</a>
</div>
<table class="replyContent">
<tr>
<th valign="top">
<div class="replyLeftTop">
发帖:<%=topic.getName()%>
<br />
</div>
<img src="image/001.jpg" alt="<%=topic.getName()%>的个人头像"
title="<%=topic.getName()%>的个人头像" />
</th>
<td valign="top">
<div class="replyListTop">
发表于:<%=topic.getTopicTime()%>
<div class="replyFloor">
楼主
</div>
</div>
<%=topic.getTopicContent()%>
</td>
</tr>
</table>
<%
int floor = 1;
//session.setAttribute("floorcount",1);
for (int j = 0; j < list.size(); j++) {
Reply reply = new Reply();
reply = (Reply) list.get(j);
%>
<table class="replyContent">
<tr>

<th valign="top">
<div class="replyLeftTop">
回帖:<%=reply.getUsername()%>
</div>
<img src="image/005.jpg" alt="<%=reply.getUsername()%>"
title="<%=reply.getUsername()%>的个人头像" />
</th>
<td valign="top">
<div class="replyListTop">
回复于:<%=reply.getReplyTime()%>
<!-- 楼层 -->
<div class="replyFloor">
<%
String s = "floorcount" + topicId;
String flag = request.getParameter("flag");
if (session.getAttribute(s) != null) {
if (flag == null) {

} else {
session.removeAttribute(s);
}

}
if (session.getAttribute(s) == null) {
out.print(floor + "楼");
} else {
out.print(Integer.parseInt(pageContext.getAttribute(s)
.toString())
+ "楼");
floor = Integer.parseInt(pageContext.getAttribute(s)
.toString());
}
floor++;
session.setAttribute(s, floor);

//floor = Integer.parseInt(session.getAttribute("floorcount").toString());
String role = (String) session.getAttribute("role");
if (role.equals("2") || role.equals("3")) {
%>
<a
href="ReplyServlet?method=deleteReply&replyId=<%=reply.getReplyId()%>&topicId=<%=topicId%>"><img
src="image/delete.gif" alt="删除此回复" title="删除此回帖"
class="deleteReply" /> </a>
<%
}
%>
</div>
</div>
<%
out.print(reply.getReplyContent());
%>

</td>
</tr>
</table>
<%
}
%>
<div>
<center>
<table>
<tr>
<td align="center" style="font: 14px 宋体;">

<%
if (pageb - 1 > 0) {
%>


<a
href="manager/lookfor.jsp?topicId=<%=topicId%>&topicName=<%=topic.getName()%>&page=1">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a
href="manager/lookfor.jsp?topicId=<%=topicId%>&topicName=<%=topic.getName()%>&page=<%=pageb - 1 <= 1 ? 1 : pageb - 1%>">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
<%
}
if (pageb < rdao.pageT) {
%>
<a
href="manager/lookfor.jsp?topicId=<%=topicId%>&topicName=<%=topic.getName()%>&page=<%=pageb + 1 >= rdao.pageT ? rdao.pageT : pageb + 1%>">下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a
href="manager/lookfor.jsp?topicId=<%=topicId%>&topicName=<%=topic.getName()%>&page=<%=rdao.pageT%>">尾页</a>
<%
}
%>

</td>
</tr>
</table>
</center>
</div>
<%
String role = (String) session.getAttribute("role");
if (!role.equals("4")) {
%>
<form action="ReplyServlet?method=reply&topicId=<%=topicId%>"
method="post" name="form1" method="post" id="form1">
回复:
<br></br>
<script type="text/javascript">
var oFCKeditor = new FCKeditor("replyContent");  
oFCKeditor.BasePath= 'fckeditor/' ;
oFCKeditor.Height= 200 ;
oFCKeditor.ToolbarSet = 'Default';
oFCKeditor.Create() ;
</script>
<br />
<input type="submit" name="sumbit" value="提交" class="coolbg np"
onclick="return check();" />
<input type="hidden" name="topicId" value="<%=topicId%>" />
<input type="reset" value="重填" class="coolbg np" />
</form>
<%
} else if (role.equals("4")) {
%>
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
<center>
<font color="#AAAAAA" size="+2"><b>==========友情提示:登陆之后你才可以回复帖子===========</b>
</font>
</center>
<%
}
%>
<br />
<br />

</div>
</body>
</html>
这个是代码!!!

[解决办法]
代码也太长了吧 ,问题说得不是太清楚啊

热点排行