九九热爱视频精品视频,久操国产精品,国产欧美日韩最新http://www.aygfsteel.com/LaozhonG/category/50810.html并不是每一次雨后,都會有彩虹zh-cnWed, 20 Nov 2013 10:14:12 GMTWed, 20 Nov 2013 10:14:12 GMT60IIS8和Apache共享開發目錄http://www.aygfsteel.com/LaozhonG/archive/2013/11/20/406579.htmlLaozhonGLaozhonGWed, 20 Nov 2013 07:32:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2013/11/20/406579.htmlhttp://www.aygfsteel.com/LaozhonG/comments/406579.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2013/11/20/406579.html#Feedback0http://www.aygfsteel.com/LaozhonG/comments/commentRss/406579.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/406579.html2013-11-20今天部署了iis8,終于配置成功了;

注意system32目錄的php_mysql.dllphp_mysqli.dll

window目錄下面需要有php.ini

以及iisfastcgi指向的php-cgi.exe所在的目錄,

phpinfo看看系統壞境變量加載的是哪個php.ini文件,

這里面的extension_dir="D:\WORK\php-5.5.5-nts\ext"

要配置正確;這樣才能訪問得到;

iis8rewrite用自帶(也可能是安裝了后的)里面的;



LaozhonG 2013-11-20 15:32 發表評論
]]>
獲取IE,FireFox和Chrome的File全路徑http://www.aygfsteel.com/LaozhonG/archive/2012/04/14/374174.htmlLaozhonGLaozhonGSat, 14 Apr 2012 08:06:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/04/14/374174.htmlhttp://www.aygfsteel.com/LaozhonG/comments/374174.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/04/14/374174.html#Feedback0http://www.aygfsteel.com/LaozhonG/comments/commentRss/374174.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/374174.html

 1 var path;
 2 function getFullPath(){
 3   if (window.navigator.userAgent.indexOf("MSIE">= 1) {//IE
 4       obj.select();
 5       path = document.selection.createRange().text;
 6 }
 7 else{//FireFox & Chrome

 8       var file =obj.files[0]; 
 9       var reader = new FileReader(); 
10       reader.onload = function(e){
11            path = e.target.result;
12       }
13       reader.readAsDataURL(file);
14     }
15 }

 

注意這邊onload 是閉包,會先執行reader.readAsDataURL(file)里面的方法。
找了好久都沒有出來,原來要這樣寫。

// objPreview.src = obj.files[0].getAsDataURL(); //這個也適用于FF
轉載自 路在何方



LaozhonG 2012-04-14 16:06 發表評論
]]>
Chrome 快捷鍵http://www.aygfsteel.com/LaozhonG/archive/2012/03/08/371547.htmlLaozhonGLaozhonGThu, 08 Mar 2012 13:13:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/03/08/371547.htmlhttp://www.aygfsteel.com/LaozhonG/comments/371547.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/03/08/371547.html#Feedback0http://www.aygfsteel.com/LaozhonG/comments/commentRss/371547.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/371547.html閱讀全文

LaozhonG 2012-03-08 21:13 發表評論
]]>
static變量、實例變量的初始化以及類加載順序過程http://www.aygfsteel.com/LaozhonG/archive/2012/02/28/370885.htmlLaozhonGLaozhonGMon, 27 Feb 2012 16:27:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/02/28/370885.htmlhttp://www.aygfsteel.com/LaozhonG/comments/370885.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/02/28/370885.html#Feedback0http://www.aygfsteel.com/LaozhonG/comments/commentRss/370885.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/370885.html  1 public class Outer {
  2 
  3     
  4     public Outer() {
  5         System.out.print("a");//構造方法,new的時候才會出現,且后于變量的創建
  6     }
  7     
  8     
  9     
 10     public static void sayOther(String s){
 11         System.out.print(s);
 12     }
 13     
 14     
 15     
 16     public int say(String s){
 17         System.out.print(s);
 18         return 0;
 19     }
 20     
 21     
 22     //初始化塊,在new時,構造方法之前,變量之前執行
 23     {
 24         System.out.print("c");
 25         inner.innerMethed("d");
 26     }
 27     
 28     
 29     private static inner t= new inner();//靜態變量,這些都是在類加載完之前就放于內存中,且只加載這一次,new類對象時是不會再次執行的了。
 30     static
 31     {
 32         System.out.print("e");
 33         inner.innerMethed("f");//靜態初始化塊,整個靜態的都是在加載之前就做好初始化。
 34         new inner();
 35     }
 36     
 37     
 38     private int i=say("g");//在new時,先于構造但是后于初始化塊的一個實例變量,也即:實例對象:(實例初始化塊,實例變量)--->構造方法
 39     private inner tt=new inner();//整個是在類加載ClassLoader之后初始化變量時,才做。每個new對象都會執行上面這個步驟
 40     private innerOther ttt=new innerOther();
 41     
 42     
 43     
 44     static class inner{
 45         
 46         
 47         public inner(){
 48             System.out.print("h");
 49         }
 50         
 51         
 52         public static void innerMethed(String s){
 53             System.out.print(s);
 54         }
 55         
 56         
 57         
 58         {
 59             System.out.print("i");
 60         }
 61         
 62         
 63         
 64         static
 65         {
 66             System.out.print("j");
 67         }
 68         
 69         
 70     }
 71     
 72     
 73     
 74     class innerOther{
 75         
 76         
 77         public innerOther(){
 78             System.out.print("k");
 79         }
 80         
 81         
 82         {
 83             System.out.print("l");
 84         }
 85         
 86         
 87         
 88     }
 89     
 90     
 91     
 92     public static void main(String[] args) {
 93         System.out.print("m");
 94         Outer outer = new Outer();
 95         System.out.print("n");
 96         
 97         //總結就是:類對象,變量的加載順序
 98         //在整個類加載完成之后,就初始化靜態(靜態變量,靜態塊),其中可以new對象,別的類調用靜態方法。靜態的只做這一次,然后類加載器ClassLoader就把類Class返還,執行main方法。
 99         //在new類對象時,執行順序是:(實例初始化塊,實例變量)-->構造方法。每new一個對象時,都會執行這個步驟。
100         
101         //(靜態變量、靜態初始化塊)—— 》 (變量、初始化塊)—— 》 構造函數,()中的內容是按照代碼前后循序執行
102        
103         //當有繼承關系時,還是基于這個原理,如new Son();
104         //父類的靜態(塊和變量)-->子類的靜態(塊和變量)-->父類的(塊和變量+構造方法)-->子類的(塊和變量+構造方法)
105         //
106     }
107 }

//類的是通過:裝載,連接,初始化
//java程序在執行過程中,類,對象以及它們成員加載、初始化的順序如下: 
// 1、首先加載要創建對象的類及其直接與間接父類。 
// 2、在類被加載的"同時"會將靜態成員進行加載,主要包括靜態成員變量的初始化,靜態語句塊的執行,在加載時按代碼的先后順序進行。 <clinit>
// 3、需要的類加載完成后,開始創建對象,首先會加載非靜態的成員,主要包括非靜態成員變量的初始化,非靜態語句塊的執行,在加載時按代碼的先后順序進行。 
// 4、最后執行構造器,構造器執行完畢,對象生成。

java中Class對象詳解     Java類加載過程

本文轉載自早餐2塊2的變態類初始化順序一文

早餐2塊2




LaozhonG 2012-02-28 00:27 發表評論
]]>
3種方法解決Struts2中forward問題!http://www.aygfsteel.com/LaozhonG/archive/2012/02/26/370793.htmlLaozhonGLaozhonGSun, 26 Feb 2012 08:47:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/02/26/370793.htmlhttp://www.aygfsteel.com/LaozhonG/comments/370793.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/02/26/370793.html#Feedback0http://www.aygfsteel.com/LaozhonG/comments/commentRss/370793.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/370793.html在Struts2中沿用Struts1.2的<jsp:forward page="xxx.action"></jsp:forward>失效,報404錯誤。因為Struts2采用過濾器的方式處理請求,REQUEST,當到達頁面時,FORWARD跳到Action。但是這個客戶端的FORWARD并沒有被攔截下來,所以找不到了。從而報出404錯。記得當時試過很多方法,都不行。連一些基本的include都無法使用,所以研究了一下,結合網友提供的。

解決辦法

1、配置web.xml 解決,增加對FORWARD請求的過濾,自然問題就解決了

1 <filter-mapping> 
2    <filter-name>struts2</filter-name> 
3    <url-pattern >/*</url-pattern> 
4    <dispatcher>INCLUDE</dispatcher>    //增加對<jsp:include page="xxx.action"/>及其<s:include value="xxx.action"/>支持
   <dispatcher>REQUEST</dispatcher> 
   <dispatcher>FORWARD</dispatcher>   
</filter-mapping> 

 

2、用javascript解決,讓請求執行到頁面時,接著執行如下的代碼,發現頁面需要重載,然后就重新發送請求REQUEST,這樣當然就會被過濾器所截獲到了。

<script language="javascript">location.replace(URL)</script>

 

3、利用html meta,等于也是讓頁面等待零秒刷新頁面,重新發送請求,達到目的。

<meta http-equiv="refresh" content="0;URL=xxx.action">

 

 


上文轉載自解決Struts2中forward問題!

LaozhonG 2012-02-26 16:47 發表評論
]]>
Struts2教程:處理一個form多個submithttp://www.aygfsteel.com/LaozhonG/archive/2012/02/20/370367.htmlLaozhonGLaozhonGMon, 20 Feb 2012 14:20:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/02/20/370367.htmlhttp://www.aygfsteel.com/LaozhonG/comments/370367.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/02/20/370367.html#Feedback1http://www.aygfsteel.com/LaozhonG/comments/commentRss/370367.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/370367.html在很多Web應用中,為了完成不同的工作,一個HTML form標簽中可能有兩個或多個submit按鈕,如下面的代碼所示:
1 <form action=""  method="post">
2  .............................................
3 <input type="submit" value="保存" />
4 <input type="submit" value="打印" />
5 </form>
由于在<form>中的多個提交按鈕都向一個action提交,使用Struts2 Actionexecute方法就無法判斷用戶點擊了哪一個提交按鈕。如果大家使用過Struts1.x就會知道在Struts1.2.9之前的版本需要使用一個LookupDispatchAction動作來處理含有多個submitform。但使用LookupDispatchAction動作需要訪問屬性文件,還需要映射,比較麻煩。從Struts1.2.9開始,加入了一個EventDispatchAction動作。這個類可以通過java反射來調用通過request參數指定的動作(實際上只是判斷某個請求參數是不存在,如果存在,就調用在action類中和這個參數同名的方法)。使用EventDispatchAction必須將submitname屬性指定不同的值以區分每個submit。而在Struts2中將更容易實現這個功能。 
   
當然,我們也可以模擬EventDispatchAction的方法通過request獲得和處理參數信息。但這
樣比較麻煩。在Struts2中提供了另外一種方法,使得無需要配置可以在同一個action類中執
行不同的方法(默認執行的是execute方法)。使用這種方式也需要通過請求參來來指定要執
行的動作。請求參數名的格式為
action!method.action
注:由于Struts2只需要參數名,因此,參數值是什么都可以。
下面我就給出一個實例程序來演示如何處理有多個submit的form:
【第1步】實現主頁面(more_submit.jsp)

 1 <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
 2 <%@ taglib prefix="s" uri="/struts-tags" %>
 3 <html>
 4 <head>
 5 <title>My JSP 'hello.jsp' starting page</title>
 6 </head>
 7 <body>
 8 <s:form action="submit.action" >
 9 <s:textfield name="msg" label="輸入內容"/>
10 <s:submit name="save" value="保存" align="left" method="save"/>
11 <s:submit name="print" value="打印" align="left" method="print" />
12 </s:form>
13 </body>
14 </html>
在more_submit.jsp中有兩個submit:保存和打印。其中分別通過method屬性指定了要調用
的方法:save和print。因此,在Action類中必須要有save和print方法。
【第2步】實現Action類(MoreSubmitAction)
 1 package action;
 2 
 3 import javax.servlet.http.*;
 4 import com.opensymphony.xwork2.ActionSupport;
 5 import org.apache.struts2.interceptor.*;
 6 public class MoreSubmitAction extends ActionSupport implements ServletRequestAware
 7 {
 8 private String msg;
 9 private javax.servlet.http.HttpServletRequest request;
10 // 獲得HttpServletRequest對象
11 public void setServletRequest(HttpServletRequest request)
12 {
13 this.request = request;
14 }
15 // 處理save submit按鈕的動作
16 public String save() throws Exception
17 {
18 request.setAttribute("result", "成功保存[" + msg + "]");
19 return "save";
20 }
21 // 處理print submit按鈕的動作
22 public String print() throws Exception
23 {
24 request.setAttribute("result", "成功打印[" + msg + "]");
25 return "print";
26 }
27 public String getMsg()
28 {
29 return msg;
30 }
31 public void setMsg(String msg)
32 {
33 this.msg = msg;
34 }
35 }
上面的代碼需要注意如下兩點:
save和print方法必須存在,否則會拋出java.lang.NoSuchMethodException異常。
Struts2 Action動作中的方法和Struts1.x Action的execute不同,只使用Struts2 Action動作的
execute方法無法訪問request對象,因此,Struts2 Action類需要實現一個Struts2自帶的攔
截器來獲得request對象,攔截器如下:
org.apache.struts2.interceptor. ServletRequestAware
【第3步】配置Struts2 Action
struts.xml的代碼如下:
 1 <?xml version="1.0" encoding="UTF-8" ?>
 2 <!DOCTYPE struts PUBLIC
 3 "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
 4 "http://struts.apache.org/dtds/struts-2.0.dtd">
 5 <struts>
 6 <package name="demo" extends="struts-default" >
 7 <action name="submit" class="action.MoreSubmitAction">
 8 <result name="save" >
 9 /result.jsp
10 </result>
11 <result name="print">
12 /result.jsp
13 </result>
14 </action>
15 </package>
16 </struts>
【第4步】編寫結果頁(result.jsp)
1 <%@ page pageEncoding="GBK"%>
2 <html>
3 <head>
4 <title>提交結果</title>
5 </head>
6 <body>
7 <h1>${result}</h1>
8 </body>
9 </html>  
 
在result.jsp中將在save和print方法中寫到request屬性中的執行結果信息取出來,并輸出到
客戶端。
啟動Tomcat后,在IE中執行如下的URL來測試程序:
http://localhost:8080/moresubmit/more_submit.jsp
大家也可以直接使用如下的URL來調用save和print方法:
調用save方法:http://localhost:8080/moresubmit/submit!save.action
調用print方法:http://localhost:8080/moresubmit/submit!print.action

以前為了寫這個想了很長時間,才知道原來name這個屬性作用還真的蠻大。
其實再非struts標簽中,即純粹的html標簽中也可以使用,寫法為:
<input type="submit" name="method:save" value="save"/>
<input type="submit" name="method:print" value="print"/>
上文出自nokiaguy的個人博客,如果想查看原文請點擊《 Struts2教程2:處理一個form多個submit


LaozhonG 2012-02-20 22:20 發表評論
]]>
Struts 2.0——Converter轉換器——批量封裝對象(Bean)http://www.aygfsteel.com/LaozhonG/archive/2012/02/20/370365.htmlLaozhonGLaozhonGMon, 20 Feb 2012 13:47:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/02/20/370365.htmlhttp://www.aygfsteel.com/LaozhonG/comments/370365.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/02/20/370365.html#Feedback1http://www.aygfsteel.com/LaozhonG/comments/commentRss/370365.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/370365.html不知道大家是否遇過這種情況,在一個頁面里同時提交幾個對象。例如,在發布產品的頁面,同時發布幾個產品。 
首先,在源代碼文件夾下的tutorial包中新建Product.java文件,內容如下: 
 1 package tutorial;
 2 
 3 import java.util.Date;
 4 
 5 publicclass Product {
 6     private String name;
 7     privatedouble price;
 8     private Date dateOfProduction;
 9     
10     public Date getDateOfProduction() {
11         return dateOfProduction;
12     }
13     
14     publicvoid setDateOfProduction(Date dateOfProduction) {
15         this.dateOfProduction = dateOfProduction;
16     }
17     
18     public String getName() {
19         return name;
20     }
21     
22     publicvoid setName(String name) {
23         this.name = name;
24     }
25     
26     publicdouble getPrice() {
27         return price;
28     }
29     
30     publicvoid setPrice(double price) {
31         this.price = price;
32     }    
33 }
然后,在同上的包下添加ProductConfirm.java類,代碼如下: 
 1 package tutorial;
 2 
 3 import java.util.List;
 4 
 5 import com.opensymphony.xwork2.ActionSupport;
 6 
 7 publicclass ProductConfirm extends ActionSupport {
 8     public List<Product> products;
 9 
10     public List<Product> getProducts() {
11         return products;
12     }
13 
14     publicvoid setProducts(List<Product> products) {
15         this.products = products;
16     }
17     
18     @Override
19     public String execute() {
20         for(Product p : products) {
21             System.out.println(p.getName() + " | "+ p.getPrice() +" | " + p.getDateOfProduction());
22         }
23         return SUCCESS;
24     }
25 }
接看,在同上的包中加入ProductConfirm-conversion.properties,代碼如下:
1 Element_products=tutorial.Product
再在struts.xml文件中配置ProductConfirm Action,代碼片段如下: 
1 <action name="ProductConfirm" class="tutorial.ProductConfirm">
2     <result>/ShowProducts.jsp</result>
3 </action>  
在WEB文件夾下新建AddProducts.jsp,內容如下:
 1 <%@ page  contentType="text/html; charset=UTF-8"%>
 2 <%@taglib prefix="s" uri="/struts-tags"%>
 3 <html>
 4 <head>
 5     <title>Hello World</title>
 6 </head>
 7 <body>
 8     <s:form action="ProductConfirm" theme="simple">            
 9         <table>
10             <tr style="background-color:powderblue; font-weight:bold;">
11                 <td>Product Name</td>
12                 <td>Price</td>
13                 <td>Date of production</td>
14             </tr>
15             <s:iterator value="new int[3]" status="stat">
16                 <tr>
17                     <td><s:textfield name="%{'products['+#stat.index+'].name'}"/></td>
18                     <td><s:textfield name="%{'products['+#stat.index+'].price'}"/></td>
19                     <td><s:textfield name="%{'products['+#stat.index+'].dateOfProduction'}"/></td>
20                 </tr>
21             </s:iterator>
22             <tr>
23                 <td colspan="3"><s:submit /></td>
24             </tr>
25         </table>
26     </s:form>    
27 </body>
28 </html>
在同樣的文件夾下創建ShowProducts.jsp,內容如下:
 1 <%@ page  contentType="text/html; charset=UTF-8"%>
 2 <%@taglib prefix="s" uri="/struts-tags"%>
 3 <html>
 4 <head>
 5     <title>Hello World</title>
 6 </head>
 7 <body>    
 8     <table>
 9         <tr style="background-color:powderblue; font-weight:bold;">
10             <td>Product Name</td>
11             <td>Price</td>
12             <td>Date of production</td>
13         </tr>
14         <s:iterator value="products" status="stat">
15             <tr>
16                 <td><s:property value="name"/></td>
17                 <td>$<s:property value="price"/></td>
18                 <td><s:property value="dateOfProduction"/></td>
19             </tr>
20         </s:iterator>
21     </table>
22 </body>
23 </html>
發布運行應用程序,在瀏覽器中鍵入http://localhost:8080/Struts2_Converter/AddProducts.jsp,出現如圖4所示頁面: 
圖4 添加產品頁面 
圖4 添加產品頁面 
按圖4所示,填寫表單,按“Submit”提交,出現圖5所示頁面: 
圖5 查看產品頁面 
圖5 查看產品頁面 
查看服務器的控制臺,有如下輸出: 
Expert One-on-One J2EE Development without EJB | 39.99 | Mon Jun 2100:00:00 CST 2004
Pro Spring | 32.99 | Mon Jan 3100:00:00 CST 2005
Core J2EE Patterns: Best Practices and Design Strategies, Second Edition | 34.64 | Sat May 1000:00:00 CST 2003

上面的代碼并不復雜,但有幾點需要說明:

  1. ProductConfirm文件中的for(Product p : productes)的寫法是J2SE 5.0中的新特性,作用遍歷products列表;
  2. List<Product>也是J2SE 5.0的才有的泛型(Generic);
  3. ProductConfirm-conversion.properties中“Element_products=tutorial.Product”是告訴Struts 2.0列表products的元素的類型為Product,而不是定義轉換器;
  4. 在AddProducts.jsp的<s:textfield>的name為“%{'products['+#stat.index+'].name'}”,%{exp}格式表示使用OGNL表達式,上述表達式的相當于<%= "products[" + stat.index + "].name" %>,至于<s:iterator>標志的用法可以參考原文主人博客的文章《常用的Struts 2.0的標志(Tag)介紹》。

     

轉換錯誤處理

不知道大家在運行上面的例子時,有沒有填錯日期或數字情況,又或者您有沒有思考過這種情況?如果還沒有嘗試的朋友可以試一下,在第一行的Price和Date of production中輸入英文字母,然后按“Submit”提交。你會看到頁面為空白,再看一下服務器的控制臺輸出,有如下語句: 警告: No result defined for action tutorial.ProductConfirm and result input,它提示我們沒有為Action定義輸入結果,所以,我們應該在源代碼文件夾下的struts.xml中的ProductConfirm Action中加入以下代碼: 

1 <result name="input">/AddProducts.jsp</result>

重新加載應用程序,刷新瀏覽器重新提交請求,這時頁面返回AddProducts.jsp,格式錯誤的輸入框的值被保留,如下圖6所示: 
圖6 沒有提示的錯返回頁面 
 圖6 沒有提示的錯返回頁面

當然,我們還可以在頁面上加上錯誤提示信息,通過在AddProducts.jsp的“<body>”后,加入下面代碼可以實現: 
<div style="color:red">
    
<s:fielderror />
</div> 

刷新瀏覽器,重新提交請求,出現如圖7所示頁面: 
圖7 帶提示的錯返回頁面 
圖7 帶提示的錯返回頁面 
以上的功能的都是通過Struts 2.0里的一個名為conversionError的攔截器(interceptor)工作,它被注冊到默認攔截器棧(default interceptor stack)中。Struts 2.0在轉換出錯后,會將錯誤放到ActionContext中,在conversionError的作用是將這些錯誤封裝為對應的項錯誤(field error),因此我們可以通過<s:fielderror />來將其在頁面上顯示出來。另外,大家看第二和第三行的Price都被賦為0.0的值,而第一行則保留其錯誤值。這同樣是conversionError的功勞——沒有出錯的行調用的products[index].price(默認值為0.0),而出錯的行則會被賦為頁面所提交的錯誤值,這樣可以提供更好的用戶體驗。 

上文中,還需要編寫一個轉換器,用于格式化日期輸入輸出!
本文轉自Max,更加詳細請看原文《轉換器(Converter)——Struts 2.0中的魔術師


LaozhonG 2012-02-20 21:47 發表評論
]]>
final,finally,finalize的區別http://www.aygfsteel.com/LaozhonG/archive/2012/02/16/370092.htmlLaozhonGLaozhonGThu, 16 Feb 2012 05:29:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/02/16/370092.htmlhttp://www.aygfsteel.com/LaozhonG/comments/370092.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/02/16/370092.html#Feedback0http://www.aygfsteel.com/LaozhonG/comments/commentRss/370092.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/370092.html    使用final關鍵字修飾一個變量時,是指引用變量不能變,引用變量所指向的對象中的內容還是可以改變的(基本數據類型:值不變;而對象類型是引用不變)。改變了棧中的內容,而棧在堆中的地址并沒有改變,也可以說指針是不變的。如:
   1 final StringBuffer sb = new StringBuffer("immutable"); 
   2 sb.append("is immutable");//這個是可以的,但是下面的這行語句是不行的,編譯報錯
   3 sb = new StringBuffer("a other immutable");
    另有在方法中有內部類,如果該方法中有對象變量的參數,此參變必須聲明為final方可使用。
2.finally是異常處理語句結構的一部分,表示總是執行。

3.finalize是Object類的一個方法,在垃圾收集器執行的時候會調用被回收對象的此方法,可以覆蓋此方法提供垃圾收集時的其他資源回收,例如關閉文件等。JVM不保證此方法總被調用。

LaozhonG 2012-02-16 13:29 發表評論
]]>
Domain Driven Design領域驅動設計http://www.aygfsteel.com/LaozhonG/archive/2012/02/14/369972.htmlLaozhonGLaozhonGTue, 14 Feb 2012 10:37:00 GMThttp://www.aygfsteel.com/LaozhonG/archive/2012/02/14/369972.htmlhttp://www.aygfsteel.com/LaozhonG/comments/369972.htmlhttp://www.aygfsteel.com/LaozhonG/archive/2012/02/14/369972.html#Feedback2http://www.aygfsteel.com/LaozhonG/comments/commentRss/369972.htmlhttp://www.aygfsteel.com/LaozhonG/services/trackbacks/369972.html大概意思就是,從領域中經過分析,討論從而提取出來的能敲到好處的描述該領域的業務的一個模型。

LaozhonG 2012-02-14 18:37 發表評論
]]>
主站蜘蛛池模板: 绥江县| 高安市| 江川县| 淅川县| 郁南县| 来凤县| 澎湖县| 和平县| 莲花县| 汕头市| 宁南县| 福海县| 朝阳区| 墨江| 南投市| 离岛区| 宽城| 昌吉市| 马尔康县| 施甸县| 泌阳县| 萍乡市| 甘孜| 阳朔县| 广平县| 大竹县| 商都县| 鄂温| 卫辉市| 耿马| 福清市| 米脂县| 永德县| 平邑县| 易门县| 固原市| 栖霞市| 香格里拉县| 灌南县| 花垣县| 阿坝|