<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    2009年8月2日

    一切都是那么的措手不及
    你來的那么突然
    令我一點防備都沒有
    我對你的到來很無奈
    但我又不得不好好待你
    你是我的眼中釘
    我的手中刺
    我發誓要殺掉你
    不讓你再禍害其他人
    我在努力地做著我該做的事
    天啊 又出bug了

    posted @ 2009-09-26 15:54 BBT_soft 閱讀(140) | 評論 (0)編輯 收藏

    163          smtp.163.com                   pop.163.com

    126          smtp.126.com                   pop3.126.com

    188          smtp.188.com                    pop3.188.com

    yeah       smtp.yeah.net                   pop3.yeah.net

    sina         smtp.sina.com                   pop.sina.com

    qq            smtp.qq.com                        pop.qq.com

    yahoo       smtp.mail.yahoo.com.cn      pop.mail.yahoo.com.cn    yahoo前提是開通來信提醒業務

    yahoo      smtp.mail.yahoo.cn              pop.mail.yahoo.cn

    google     smtp.gmail.com                    pop.gmail.com

    tom          smtp.tom.com                       pop.tom.com

    sogou      smtp.mail.sogou.com            pop3.mail.sogou.com

    sohu        smtp.sohu.com                     pop3.sohu.com

    139          smtp.139.com                       pop.139.com

    china        smtp.china.com                    pop.china.com    中華網郵箱

    21CN        smtp.21cn.net                      pop3:pop.21cn.net     商務郵箱服務器

                     smtp.21cn.com                     pop3:pop.21cn.com    經濟郵箱服務器
             
                     smtp.21cn.com                     pop3:pop.21cn.com 免費郵箱服務器

    posted @ 2009-08-08 12:42 BBT_soft 閱讀(2715) | 評論 (4)編輯 收藏

    《think in java》中有這么一段話:

    如果想比較兩個對象的實際內容是否相同,又該如何操作呢?此時,必須使用所有對象都使用的特殊方法equals()。但這個方法不適用于"基本類型",基本類型直接使用==和!=即可。如:

    Integer n1 = new Integer(47);
    Integer n2 = new Integer(47);
    System.out.println(ne.equals(n2));

    正如我們預計的那樣,此時得到的結果是true。但事實上并不總是這么簡單!假設您創建了自己的類,像下面這樣:
    class Value{
    int i;
    }
    public class Test{

          public static void main(String[] args){
                 Value v1 = new Value();
                Value v2 = new Value();
                 System.out.println(v1.equals(v2));
        }
    }
    此時的結果又變回了false!

    這是由于equals()的默認行為是比較引用。所以除非在自己的新類中重載equals()方法,否則不可能表現出我們希望的行為。

    大多數Java類庫都實現了用來比較對象內容的equals()方法,而非比較對象引用的equals()方法。

    個人理解:equals()默認行為是比較引用,只是現在絕大多數Java類庫都實現了用來比較對象內容的equals()方法,而并沒有實現比較對象引用的equals()方法。所以現在說equals()比較的是內容,如果自己的類實現比較對象引用的equals()方法,也可以說equals()比較對象的引用,只是實現問題。

    posted @ 2009-08-08 12:38 BBT_soft 閱讀(2035) | 評論 (6)編輯 收藏

    由于我用的是struts框架,就拿整個項目介紹:

    1.首先把jstl的兩個常用包jstl.jar、standard.jar加載到環境中

    2.Action代碼:(整個過程不需要了解,這兒方法就是返回一個封裝Students對象的list,然后request.setAttribute("list", list)起來)

    public ActionForward selectStudent(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) {
       StudentForm studentForm = (StudentForm) form;
       DBConnection dbconn = new DBConnection();
       Connection conn = dbconn.getConnection();
       StudentServiceFactory serviceFactory = new StudentServiceFactory();
       List list = serviceFactory.getStudentService().selectStudent(conn);
       request.setAttribute("list", list);
       try {
        conn.close();
       } catch (SQLException e) {
        e.printStackTrace();
       }
       return mapping.findForward("show");
    }

    3.show.jsp頁面:

    <%@ page language="java" pageEncoding="utf-8"%>
    <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>//這三句很重要

    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>

    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%
    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 'show.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>
        查詢結果如下: <br>
    <table>
       <tr>
        <td>ID</td>
        <td>姓名</td>
       </tr>
      <c:forEach items="${list}" var="student">// items為list的一個迭代器,list為Action中傳遞過來的list,student為Student類對象
       <tr>
       <td>${student.id }</td>//輸出student的id屬性
        <td>${student.name }</td>//輸出student的name屬性
       </tr>
       </c:forEach>

    <logic:iterate id="li" name="list" type="vo.Student">//id為自定義的名字,name為Action中傳過來的list,type為實體類,包括完整路徑,這里是vo.Student
        <tr>
         <td><bean:write name="li" property="id"/></td>//name為邏輯名,和logic:iterate id="li"中的id對應,property為實體類中真正的屬性
         <td><bean:write name="li" property="name"/></td>
         <td><a href="student.do?method=deleteStudent&id=<bean:write name="li" property="id"/>">刪除</a></td>
        </tr>
       </logic:iterate>


    </table>
    <a href="student.jsp">返回</a>
    </body>
    </html>

    在JSP頁面引入Struts標簽庫的時候有所不同:

    struts1.3的為:

    <%@ taglib uri=" <%@ taglib uri=" <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>或者<%@ taglib uri="

    posted @ 2009-08-02 16:21 BBT_soft 閱讀(2175) | 評論 (1)編輯 收藏

    主站蜘蛛池模板: 大陆一级毛片免费视频观看i| 国国内清清草原免费视频99| 日本成人在线免费观看| 亚洲综合色7777情网站777| 在线永久看片免费的视频| 亚洲理论在线观看| 国内精自视频品线六区免费| 亚洲人成网网址在线看| 国产免费看JIZZ视频| 亚洲国产区男人本色在线观看| 成人午夜视频免费| 亚洲a∨无码一区二区| 久久久久久国产a免费观看不卡| 亚洲视频免费在线播放| 亚洲精品无码久久久久久久| 免费在线看v网址| 国产成人亚洲精品蜜芽影院| 亚洲视频在线精品| 免费一级毛片在线播放视频| 亚洲专区先锋影音| 在线免费观看污网站| 日韩大片在线永久免费观看网站| 免费无码AV片在线观看软件| 亚洲AV永久无码天堂影院 | 永久免费A∨片在线观看| 日本不卡在线观看免费v| 男女啪啪免费体验区| 亚洲欧洲日产国码av系列天堂| 67194国产精品免费观看| 亚洲老熟女五十路老熟女bbw| 亚洲高清最新av网站| 一区二区三区福利视频免费观看| 亚洲一区二区三区免费视频| 四虎免费永久在线播放| 免费国产在线视频| 亚洲色偷偷偷综合网| 国产aⅴ无码专区亚洲av麻豆 | 亚洲一卡2卡三卡4卡无卡下载| 亚洲av再在线观看| 亚洲大片免费观看| www免费插插视频|