Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Servlet/JSP/JSF/JavaFX Script  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
reply to postflat modethreaded modego to previous topicgo to next topicgo to back
作者 jsp乱码问题
andilyliao





发贴: 40
于 2006-02-19 14:36 user profilesend a private message to userreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
在第一页jiaos.jsp中
<%
    try
    {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      Connection con=DriverManager.getConnection("jdbc:odbc:teacher");
      Statement stm=con.createStatement();
      String sqlf="select * from table1";
      ResultSet rers=stm.executeQuery(sqlf);    
      String ttname;
      while(rers.next())
       {
        ttname=rers.getString("tname");
        out.println("<tr>");
        out.println("<td width='770' height='28' background='images1/back (5).jpg' scope='col' align='center'>");
        out.println("<form action='teacher2.jsp' method='post'>");
        out.println("<input name='lookup' type='submit' value='查看'>");
        out.println("<input name='textnamett' type='hidden' value='" + ttname + "'>");
        out.println("</form>");
        out.println(ttname);
        out.println("</tr>");
        out.println("</td>");
      }
      stm.close();
      con.close();
    }
    catch(Exception e)
    {
    }

     %>
在第二页teacher2.jsp中
<%=request.getParameter("textnamett")%>
读出的textnamett就是乱码了




JAVA学习日子分享

话题树型展开
人气 标题 作者 字数 发贴时间
2604 jsp乱码问题 andilyliao 1031 2006-02-19 14:36
2444 Re:jsp乱码问题 xiaoqiang 29 2006-02-20 16:36
2100 Re:jsp乱码问题 andilyliao 28 2006-02-21 20:28
2350 Re:jsp乱码问题 xiaoqiang 43 2006-02-22 09:02
2452 Re:jsp乱码问题 xiaoqiang 285 2006-02-22 09:08
2115 Re:jsp乱码问题 andilyliao 8 2006-02-22 16:52

reply to postflat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923