搜尋此網誌

2011年12月24日 星期六

Html input tag usage(Html input標籤的使用方式)

input元件可以使用在form標籤裡面, 用來宣告允許使用者輸入資料的方法.

以下列出一些常用的input type的輔助attributes 的用法:

input type可以為
button,
checkbox,
hidden(一個隱藏的input 欄位),
password(密碼欄位,在此欄位的文字都會被mask起來.),
radio,
reset(所有表單欄位內的資料,會被設回預設值.),
submit(把欄位內的資料傳送到server),
text(一個可以給使用者輸入文字的欄位,預設可輸入20個字)




參考自W3C網站

Create JavaScript Object(創建JavaScript 物件)

建立一個Student class, 擁有name這個property,以及getName這個方法.


然後依據Student這個class,實體化出一個Student物件.


在這裡要注意到的地方是, 因為Student有預設的Constructor(建構子),需要丟入一個參數


做為name這個屬性的值,否則的話會列印出undefined.




下面是另一個創立物件,物件的屬性和方法的寫法:



第三個創立物件,物件的屬性和方法的寫法:

2011年12月7日 星期三

12月的第七天

最近忙著找工作,現在才寫月誌.這個月的重點還是放在要多寫一些有品質的技術文章, 網站瀏覽人數,

近幾個月都呈現很穩定的流量, 這是很值得高興的.

Spring 特點(feature)

Spring includes:

  • 最完整的輕量化容器(lightweight container), providing centralized, automated configuration and wiring of your application objects. 這一個容器是非侵入性的(non-invasive), 可以由一系列的(POJOs)組成一個複雜的system ,並且遵循著一致化和透明的設計概念. The container brings agility and leverage, and improves application testability and scalability by allowing software components to be first developed and tested in isolation, then scaled up for deployment in any environment (J2SE or J2EE).

  • 為transaction management提供一個共同的抽象層(abstraction layer),允許可抽換式的交易管理, 使得劃分交易變的很簡單而不需要去處理low-level issues. Generic strategies for JTA and a single JDBC DataSource are included. 不同於原有的 JTA(Java Transaction Interface) or EJB CMT, Spring所支援的交易管理並不僅僅限於J2EE下的環境.

  • JDBC的抽象層 提供了一個有意義的例外架構, (no more pulling vendor codes out of SQLException), 簡化了錯誤處理,並且大大降低了你所需要寫的程式碼. You'll never need to write another finally block to use JDBC again. The JDBC-oriented exceptions comply to Spring's generic DAO(Data Access Objects) exception hierarchy.

  • 整合了 Toplink, Hibernate, JDO, and iBATIS SQL Maps: in terms of resource holders, DAO implementation support, and transaction strategies. First-class Hibernate support with lots of IoC convenience features, addressing many typical Hibernate integration issues. All of these comply to Spring's generic transaction and DAO exception hierarchies.

  • AOP(Aspect-oriented programming) functionality, fully integrated into Spring configuration management. You can AOP-enable any object managed by Spring, adding aspects such as declarative transaction management. 假如你正在Tomcat使用單一的資料庫或是任何其他沒有JTA支援的web容器,有了Spring, 你可以宣告(declarative)交易管理而不必依靠EJB,甚至不必JTA.

  • 靈活的MVC網頁應用程式框架. This framework is highly configurable via strategy interfaces, and accommodates multiple view technologies like JSP, Velocity, Tiles, iText, and POI. Spring中介層可以輕易地結合任何Web MVC框架的Web層,好比Struts, WebWork, or Tapestry.

你可以在任何的J2EE環境使用Spring所有的功能. Spring是以商業邏輯和DAO可重複使用,並且不

受限於任何特定的J2ee服務為中心思想而設計的. 物件可以毫無障礙的跨越:J2ee的環境, 單機應

用程式, 以及測試環境重複使用.

Spring的階層架構給予你很多的彈性. 它所有的功能都是根據前一個lower level而來的. 比如說,你

可以使用JavaBeans的設定管理(configuration management)而不必使用到MVC framework or

AOP support. 但是假如你要使用MVC framework or AOP support,你會發現到它們都是建立在核

心的Spring設定裡,所以你在這方面的知識可以立刻派上用場.




節錄翻譯自http://www.springsource.org/spring-core#documentation