这样只要机器装word就是默认打开了

解决方案 »

  1.   

    <%@ contentType="text/html;charset=gb2312%>
    是把这局加上吗?
      

  2.   

    <%@ contentType="text/html;charset=gb2312%>
    把这局加上也是乱码啊?
      

  3.   

    加上这句<%@ page contentType="text/html;charset=gb2312"%>
    同时在你的JSP代码里还加上
    <% request.setCharacterEncoding("GBK");
    %>试试哈
      

  4.   

    大哥加上<% request.setCharacterEncoding("GBK");
    %>也不行?
      

  5.   

    文件如下:
    <%@ contentType="text/html;charset=gb2312%><%Cookie cookies[]=request.getCookies();
    if(cookies==null){ response.sendRedirect("login.jsp"); }
    %>
    <%@ include file="articleconn.jsp"%><%String articleid=request.getParameter("id");stmt.executeUpdate("update news.learning set hits=hits+1 where articleid="+articleid);String sql="select * from news.learning where articleid="+articleid; 
    ResultSet rs=stmt.executeQuery(sql);  while(rs.next()) {%>
    <html>
    <head>
    <title><%=rs.getString("title")%></title>
    <link rel="stylesheet" href="css/article.css">
    </head><body bgcolor="#FFFFFF"><div align="center">
      <center>
        <table cellspacing="0" width="100%" border="1" bordercolorlight="#000000"
    bordercolordark="#FFFFFF">
          <tr bgcolor="#CCCCCC"> 
            <td height="2" class="title" colspan="4" bgcolor="#B5D85E"> 
              <div align="center">信息查询系统</div>
            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="20" class="title" colspan="4"> 
            
              <blockquote> 
                <div align="center"></div>
                <table width="65%" border="0" cellspacing="0" cellpadding="0" align="center">
                  <tr> 
                    <td colspan="2"> 
                      <div align="center">编号:<b><%=rs.getString("articleid")%></b></div>
                    </td>
                  </tr>
                  <tr> 
                    <td colspan="2">&nbsp;</td>
                  </tr>
                  <tr> 
                    <td colspan="2">信息名称:<b><%=rs.getString("title")%></b></td>
                  </tr>
                  <tr> 
                    <td colspan="2">&nbsp;</td>
                  </tr>
                  <tr> 
                    <td width="60%">信息类型:<%=rs.getString("type")%></td>
                    <td width="40%">信息评价:<font color="#FF0000"><%=rs.getString("vote")%></font></td>
                  </tr>
                  <tr> 
                    <td width="60%">&nbsp;</td>
                    <td width="40%">&nbsp;</td>
                  </tr>
                  <tr>                 <td width="60%">信息大小:<%=rs.getString("big")%></td>
                    <td width="40%">相关链接:<a href="<%=rs.getString("fromurl")%>"><%=rs.getString("from1")%></a></td>
                  </tr>
                  <tr> 
                    <td width="60%">&nbsp;</td>
                    <td width="40%">&nbsp;</td>
                  </tr>
                  <tr> 
                    <td width="60%">时间:<%=rs.getString("dateandtime")%></td>
                    <td width="40%">次数:<%=rs.getString("hits")%></td>
                  </tr>
                  <tr> 
                    <td width="60%">&nbsp;</td>
                    <td width="40%">&nbsp;</td>
                  </tr>
                  <tr> 
                    <td colspan="2">&nbsp;</td>
                  </tr>
                  <tr> 
                    <td colspan="2"> 
                      <p>信息简介:</p>
                    </td>
                  </tr>
                  <tr> 
                    <td colspan="2"> 
                      <blockquote> 
                        <p><%=rs.getString("content")%></p>
                      </blockquote>
                    </td>
                  </tr>
                  <tr> 
                    <td colspan="2"> 
                      <div align="center">|<a href="javascript:self.close()">关闭本窗口</a>|</div>
                    </td>
                  </tr>
                </table>
                <blockquote>
                  <p>&nbsp; </p>
                </blockquote>
              </blockquote>
            </td>
          </tr>
        </table>
        <div align="center"></div>
      </center>
    </div></body>
    </html>
    <%}
    rs.close(); stmt.close(); conn.close(); 
    %>