- 浏览: 126548 次
- 来自: ...
最近访客 更多访客>>
文章分类
最新评论
-
dwangel:
给messageSource设置属性
<property ...
Spring i18n的better practice(相对于appfuse) -
dwangel:
spring 的message tag有一个属性text,可以 ...
Spring i18n的better practice(相对于appfuse) -
sn201:
awk高级篇
有问题啊!有问题!有问题!有问题!有问题!
i ...
awk文本处理总结(入门,中级,高级) -
happy_javaboy:
...
Log4j日志管理系统简单使用说明
注éç®åäºæ°æ®éªè¯ |
|
级å«: ä¸çº§
Ted Bergeron
(ted@triview.com), åä½åå§äºº, Triview, Inc.
2006 å¹´ 10 æ 10 æ¥
å°½ç®¡å¨ Web åºç¨ç¨åºä¸å°½å¯è½å¤çå±æ¬¡ä¸æ建æ°æ®éªè¯é常éè¦ï¼ä½æ¯è¿æ ·åå´é常èæ¶ï¼ä»¥è³äºå¾å¤å¼å人åé½ä¼å¹²è忽ç¥è¿ä¸ªæ¥éª¤ ââ è¿å¯è½ä¼å¯¼è´ä»å大éé®é¢ç产çãä½æ¯éçææ°çæ¬ç Java å¹³å°ä¸å¼å ¥äºæ³¨éï¼éªè¯åå¾ç®åå¾å¤äºãå¨æ¬æä¸ï¼Ted Bergeron å°åæ¨ä»ç»å¦ä½ä½¿ç¨ Hibernate Annotations ç Validator ç»ä»¶å¨ Web åºç¨ç¨åºä¸è½»æ¾æ建并维æ¤éªè¯é»è¾ã<!--START RESERVED FOR FUTURE USE INCLUDE FILES--> <!-- include java script once we verify teams wants to use this and it will work on dbcs and cyrillic characters --> <!--END RESERVED FOR FUTURE USE INCLUDE FILES-->
ææ¶ä¼æä¸ç§å·¥å ·ï¼å®å¯ä»¥çæ£æ»¡è¶³å¼å人ååæ¶æå¸çéæ±ãå¼å人åå¨ç¬¬ä¸æ¬¡ä¸è½½è¿ç§å·¥å ·å½å¤©å°±å¯ä»¥å¨èªå·±çåºç¨ç¨åºä¸å¼å§ä½¿ç¨è¿ç§å·¥å ·ãç论ä¸æ¥è¯´ï¼è¿ç§å·¥å ·å¨å¼å人åè±è´¹å¤§éæ¶é´æ¥ææ¡å ¶ç¨æ³ä¹åå°±å¯ä»¥ä»ä¸è·çãæ¶æå¸ä¹å¾å欢è¿ç§å·¥å ·ï¼å 为å®å¯ä»¥å°å¼å人å导åæ´é«ç论å±æ¬¡çå®ç°ãHibernate Annotations ç Validator ç»ä»¶å°±æ¯ä¸ç§è¿æ ·çå·¥å ·ã
|
Java SE 5 为 Java è¯è¨æä¾äºå¾å¤éè¦çå¢å¼ºåè½ï¼ä¸è¿å ¶ä»å¢å¼ºåè½å¯è½é½ä¸å¦ 注é è¿æ ·æ½å巨大ãä½¿ç¨ æ³¨éï¼æ们就ç»äºå ·æäºä¸ä¸ªæ åãä¸çº§çå æ°æ®æ¡æ¶ä¸º Java 类使ç¨ãHibernate ç¨æ·æå·¥ç¼å *.hbm.xml æ件已ç»å¾å¤å¹´äºï¼æè ä½¿ç¨ XDoclet æ¥èªå¨å®ç°è¿ä¸ªä»»å¡ï¼ãå¦ææå·¥åå»ºäº XML æ件ï¼é£å°±å¿ 须对æ¯ä¸ªæéè¦çæä¹ å±æ§é½æ´æ°è¿ä¸¤ä¸ªæ件ï¼ç±»å®ä¹å XML æ å°ææ¡£ï¼ãä½¿ç¨ HibernateDoclet å¯ä»¥ç®åè¿ä¸ªè¿ç¨ï¼è¯·åçæ¸ å 1 ç»åºçä¾åï¼ï¼ä½æ¯è¿éè¦æ们确认èªå·±ç HibernateDoclet çæ¬æ¯æè¦ä½¿ç¨ç Hibernate ççæ¬ãdoclet ä¿¡æ¯å¨è¿è¡æ¶ä¹æ¯ä¸å¯ç¨çï¼å 为å®è¢«ç¼åå°äº Javadoc é£æ ¼ç注éä¸äºãHibernate Annotationsï¼å¦å¾ 2 æ示ï¼éè¿æä¾ä¸ä¸ªæ åãç®æçæ å°ç±»çæ¹æ³åææ·»å çè¿è¡æ¶å¯ç¨æ§æ¥å¯¹è¿äºæ¹å¼è¿è¡æ¹è¿ã
æ¸ å 1. ä½¿ç¨ HibernateDoclet ç Hibernate æ å°ä»£ç
/** * @hibernate.property column="NAME" length="60" not-null="true" */ public String getName() { return this.name; } /** * @hibernate.many-to-one column="AGENT_ID" not-null="true" cascade="none" * outer-join="false" lazy="true" */ public Agent getAgent() { return agent; } /** * @hibernate.set lazy="true" inverse="true" cascade="all" table="DEPARTMENT" * @hibernate.collection-one-to-many class="com.triview.model.Department" * @hibernate.collection-key column="DEPARTMENT_ID" not-null="true" */ public List<Department> getDepartment() { return department; } |
æ¸ å 2. ä½¿ç¨ Hibernate Annotations ç Hibernate æ å°ä»£ç
@NotNull @Column(name = "name") @Length(min = 1, max = NAME_LENGTH) // NAME_LENGTH is a constant declared elsewhere public String getName() { return name; } @NotNull @ManyToOne(cascade = {CascadeType.MERGE }, fetch = FetchType.LAZY) @JoinColumn(name = "agent_id") public Agent getAgent() { return agent; } @OneToMany(mappedBy = "customer", fetch = FetchType.LAZY) public List<Department> getDepartment() { return department; } |
å¦æä½¿ç¨ HibernateDocletï¼é£ä¹ç´å°çæ XML æ件æè¿è¡æ¶æè½æè·é误ãä½¿ç¨ æ³¨éï¼å¨ç¼è¯æ¶å°±å¯ä»¥æ£æµåºå¾å¤é误ï¼æè
å¦æå¨ç¼è¾æ¶ä½¿ç¨äºå¾å¥½ç IDEï¼é£ä¹å¨ç¼è¾æ¶å°±å¯ä»¥æ£æµåºé¨åé误ãå¨ä»å¤´å建åºç¨ç¨åºæ¶ï¼å¯ä»¥å©ç¨ hbm2ddl å·¥å
·ä¸ºèªå·±çæ°æ®åºä» hbm.xml æ件ä¸çæ DDLãä¸äºéè¦çä¿¡æ¯ ââ æ¯å¦name
å±æ§çæ大é¿åº¦å¿
é¡»æ¯ 60 个å符ï¼æè
DDL åºè¯¥æ·»å é空约æ ââ é½è¢«ä» HibernateDoclet 项添å å° DDL ä¸ãå½ä½¿ç¨æ³¨éæ¶ï¼æ们å¯ä»¥ä»¥ç±»ä¼¼çæ¹å¼èªå¨çæ DDLã
尽管è¿ä¸¤ç§ä»£ç æ å°æ¹å¼é½å¯ä»¥ä½¿ç¨ï¼ä¸è¿æ³¨éçä¼å¿æ´ä¸ºææ¾ã使ç¨æ³¨éï¼å¯ä»¥ç¨ä¸äºå¸¸éæ¥æå®é¿åº¦æå ¶ä»å¼ãç¼è¯å¾ªç¯çé度æ´å¿«ï¼å¹¶ä¸ä¸éè¦çæ XML æ件ãå ¶ä¸æ大çä¼å¿æ¯å¯ä»¥è®¿é®ä¸äºæç¨ä¿¡æ¯ï¼ä¾å¦è¿è¡æ¶çé空注éæé¿åº¦ãé¤äºæ¸ å 2 ç»åºç注éä¹å¤ï¼è¿å¯ä»¥æå®ä¸äºéªè¯ç约æãæå å«çé¨å约æå¦ä¸ï¼
-
@Max(value = 100)
-
@Min(value = 0)
-
@Past
-
@Future
-
@Email
å¨éå½æ¡ä»¶ä¸ï¼è¿äºæ³¨éä¼å¼èµ·ç± DDL çææ£æ¥çº¦æãï¼æ¾ç¶ï¼@Future
并ä¸æ¯ä¸ä¸ªéå½çæ¡ä»¶ãï¼è¿å¯ä»¥æ ¹æ®éè¦å建å®å¶çº¦æ注éã
ç¼åéªè¯ä»£ç æ¯ä¸ä¸ªç¦äººä¸èæ¶çè¿ç¨ãé常ï¼å¾å¤å¼å人åé½ä¼æ¾å¼å¨ç¹å®çå±è¿è¡æææ§éªè¯ï¼ä»èå¯ä»¥èçä¸äºæ¶é´ï¼ä½æ¯æèççæ¶é´æ¯å¦è½å¤å¼¥è¡¥å¨è¿ä¸ªå°æ¹å 忽ç¥é¨ååè½æå¼èµ·ç缺é·å´é常å¼å¾æ¢è®¨ãå¦æå¨ææåºç¨ç¨åºå±ä¸å建并维æ¤éªè¯æéè¦çæ¶é´å¯ä»¥æ大å°åå°ï¼é£ä¹äºè®ºçç¦ç¹å°±ä¼è½¬åæ¯å¦è¦å¨å¤ä¸ªå±æ¬¡ä¸è¿è¡æææ§éªè¯ãå设æä¸ä¸ªåºç¨ç¨åºï¼å®è®©ç¨æ·ä½¿ç¨ä¸ä¸ªç¨æ·åãå¯ç åä¿¡ç¨å¡å·æ¥å建ä¸ä¸ªå¸å·ãå¨è¿ä¸ªåºç¨ç¨åºä¸æå¸æè¿è¡éªè¯çç»ä»¶å¦ä¸ï¼
-
è§å¾ï¼ éè¿ JavaScript è¿è¡éªè¯å¯ä»¥é¿å
ä¸æå¡å¨åå¤è¿è¡äº¤äºï¼è¿æ ·å¯ä»¥æä¾æ´å¥½çç¨æ·ä½éªãç¨æ·å¯ä»¥ç¦ç¨ JavaScriptï¼å æ¤è¿ä¸ªå±æ¬¡çéªè¯æ好è¦æï¼ä½æ¯å´å¹¶ä¸å¯é ã对æéè¦çåè¿è¡ç®åçéªè¯æ¯å¿
é¡»çã
-
æ§å¶å¨ï¼ éªè¯å¿
é¡»å¨æå¡å¨ç«¯çé»è¾ä¸è¿è¡å¤çãè¿ä¸ªå±æ¬¡ä¸ç代ç å¯ä»¥ä»¥éåæ个ç¹å®ç¨éçæ¹å¼å¤çéªè¯ãä¾å¦ï¼å¨æ·»å æ°ç¨æ·æ¶ï¼æ§å¶å¨å¯ä»¥å¨è¿è¡å¤çä¹åæ£æ¥æå®çç¨æ·åæ¯å¦å·²ç»åå¨ã
-
æå¡ï¼ ç¸å¯¹å¤æçä¸å¡é»è¾éªè¯é常é½æéåæ¾å°æå¡å±ä¸ãä¾å¦ï¼ä¸æ¦æä¸ä¸ªä¿¡ç¨å¡å¯¹è±¡çèµ·æ¥ææï¼å°±åºè¯¥ä½¿ç¨ä¿¡ç¨å¡å¤çæå¡å¯¹è¿ä¸ªä¿¡ç¨å¡çä¿¡æ¯è¿è¡ç¡®è®¤ã
-
DAOï¼ å¨æ°æ®å°è¾¾è¿ä¸ªå±æ¬¡æ¶ï¼åºè¯¥å·²ç»æ¯ææçäºã尽管å¦æ¤ï¼æ§è¡ä¸æ¬¡å¿«éæ£æ¥ä»èç¡®ä¿æéè¦çåé½é空并ä¸å¼ä¹é½å¨ç¹å®çèå´æéµå¾ªç¹å®çæ ¼å¼ï¼ä¾å¦ e-mail å°ååå°±åºè¯¥å
å«ä¸ä¸ªææç e-mail å°åï¼ä¹æ¯é常æççãå¨æ¤å¤æè·é误æ»æ¯äº§çå¯ä»¥é¿å
ç
SQLException
é误è¦å¥½ã
-
DBMSï¼ è¿æ¯é常å¯ä»¥å¿½ç¥éªè¯çå°æ¹ãå³ä½¿å½åæ£å¨æ建çåºç¨ç¨åºæ¯æ°æ®åºçæä¸å®¢æ·æºï¼å°æ¥è¿å¯è½ä¼æ·»å å
¶ä»å®¢æ·æºãå¦æåºç¨ç¨åºæä¸äº bugï¼å¤§é¨ååºç¨ç¨åºé½å¯è½ä¼æ bugï¼ï¼é£ä¹æ æçæ°æ®ä¹å¯è½ä¼è¢«åéç»æ°æ®åºãå¨è¿ç§æ
åµä¸ï¼å¦æèµ°è¿ï¼å°±å¯ä»¥æ¾å°æ æçæ°æ®ï¼å¹¶ä¸éè¦åæè¿äºæ°æ®æ¯å¦å¯ä»¥æ¸
é¤ï¼ä»¥åå¦ä½æ¸
é¤ã
- 模åï¼ è¿æ¯è¿è¡éªè¯çä¸ä¸ªçæ³å°æ¹ï¼å®ä¸éè¦è®¿é®å¤é¨æå¡ï¼ä¹ä¸éè¦äºè§£æä¹ æ§æ°æ®ãä¾å¦ï¼æä¸å¡é»è¾å¯è½ä¼è¦æ±ç¨æ·è³å°æä¾ä¸ä¸ªè系信æ¯ï¼è¿å¯ä»¥æ¯ä¸ä¸ªçµè¯å·ç ä¹å¯ä»¥æ¯ä¸ä¸ª e-mail å°åï¼å¯ä»¥ä½¿ç¨æ¨¡åå±çéªè¯æ¥ç¡®ä¿ç¨æ·çç¡®æä¾äºè¿ç§ä¿¡æ¯ã
è¿è¡éªè¯çä¸ç§å ¸åæ¹æ³æ¯å¯¹ç®åçéªè¯ä½¿ç¨ Commons Validatorï¼å¹¶å¨æ§å¶å¨ä¸ç¼åå ¶ä»ä¸äºéªè¯é»è¾ãCommons Validator å¯ä»¥çæ JavaScript æ¥å¯¹è§å¾ä¸çéªè¯è¿è¡å¤çãä½æ¯ Commons Validator ä¹æèªå·±ç缺é·ï¼å®åªè½å¤çç®åçéªè¯é®é¢ï¼å¹¶ä¸å°éªè¯çä¿¡æ¯é½ä¿åå°äº XML æ件ä¸ãCommons Validator 被设计ç¨æ¥ä¸ Struts ä¸èµ·ä½¿ç¨ï¼èä¸æ²¡ææä¾ä¸ç§ç®åçæ¹æ³å¨åºç¨ç¨åºå±é´éç¨éªè¯ç声æã
å¨è§åæææ§éªè¯çç¥æ¶ï¼éæ©å¨é误åçæ¶ç®åå°å¤çè¿äºé误æ¯è¿è¿ä¸å¤çãä¸ç§è¯å¥½ç设计åæ¶è¿è¦éè¿çæä¸ä¸ªå好çç¨æ·çé¢æ¥é²æ¢åºç°é误ãéç¨é¢å
è¿è¡çæ¹æ³è¿è¡éªè¯å¯ä»¥æ大å°å¢å¼ºç¨æ·å¯¹äºåºç¨ç¨åºçç解ãä¸å¹¸çæ¯ï¼Commons Validator 并没æ对æ¤æä¾æ¯æãå设å¸æ HTML æ件设置ææ¬åç maxlength
å±æ§æ¥ä¸éªè¯å¹é
ï¼æè
å¨ææ¬åä¹åæ¾ä¸ä¸ä¸ªç¾åå·ï¼%ï¼æ¥è¡¨ç¤ºè¦è¾å
¥ç¾åæ¯çå¼ãé常ï¼è¿äºä¿¡æ¯é½è¢«ç¡¬ç¼åå° HTML ææ¡£ä¸äºãå¦æå³å®ä¿®æ¹ name
å±æ§æ¥æ¯æ 75 个å符ï¼èä¸æ¯ 60 个å符ï¼é£ä¹éè¦æ¹å¨å¤å°å°æ¹å¢ï¼å¨å¾å¤åºç¨ç¨åºä¸ï¼é常é½éè¦ï¼
- æ´æ° DDL æ¥å¢å¤§æ°æ®åºåçé¿åº¦ï¼éè¿ HibernateDocletã hbm.xml æ Hibernate Annotationsï¼ã
- æ´æ° Commons Validator XML æ件å°æ大å¼å¢å å° 75ã
- æ´æ°ææä¸è¿ä¸ªåæå
³ç HTML 表åï¼ä»¥ä¿®æ¹
maxlength
å±æ§ã
æ´å¥½çæ¹æ³æ¯ä½¿ç¨ Hibernate Validatorãéªè¯çå®ä¹é½è¢«éè¿æ³¨é æ·»å å°äºæ¨¡åå±ä¸ï¼åæ¶è¿æ对æå å«çéªè¯å¤ççæ¯æãå¦æéæ©å åå©ç¨ææç Hibernateï¼è¿ä¸ª Validator å°±å¯ä»¥å¨ DAO å DBMS å±ä¹æä¾éªè¯ãå¨ä¸é¢ç»åºçæ ·ä¾ä»£ç ä¸ï¼å°ä½¿ç¨ reflection å JSP 2.0 æ ç¾æ件å¤æ§è¡ä¸ä¸ªæ¥éª¤ï¼ä»èå åå©ç¨æ³¨é 为è§å¾å±å¨æçæ代ç ãè¿å¯ä»¥æ¸ é¤å¨è§å¾ä¸ä½¿ç¨ç硬ç¼åçä¸å¡é»è¾ã
å¨æ¸
å 3 ä¸ï¼dateOfBirth
被注é为 NotNull
åè¿å»çæ¥æã Hibernate ç DDL çæ代ç 对è¿ä¸ªåæ·»å äºä¸ä¸ªé空约æï¼ä»¥åä¸ä¸ªè¦æ±æ¥æå¿
é¡»æ¯ä¹åæ¥æçæ£æ¥çº¦æãe-mail å°åä¹æ¯é空çï¼å¿
é¡»å¹é
e-mail å°åçæ ¼å¼ãè¿ä¼çæä¸ä¸ªé空约æï¼ä½æ¯ä¸ä¼çæå¹é
è¿ç§æ ¼å¼çæ£æ¥çº¦æã
æ¸ å 3. éè¿ Hibernate Annotations è¿è¡æ å°çç®åèç³»æ¹å¼
/** * A Simplified object that stores contact information. * * @author Ted Bergeron * @version $Id: Contact.java,v 1.1 2006/04/24 03:39:34 ted Exp $ */ @MappedSuperclass @Embeddable public class Contact implements Serializable { public static final int MAX_FIRST_NAME = 30; public static final int MAX_MIDDLE_NAME = 1; public static final int MAX_LAST_NAME = 30; private String fname; private String mi; private String lname; private Date dateOfBirth; private String emailAddress; private Address address; public Contact() { this.address = new Address(); } @Valid @Embedded public Address getAddress() { return address; } public void setAddress(Address a) { if (a == null) { address = new Address(); } else { address = a; } } @NotNull @Length(min = 1, max = MAX_FIRST_NAME) @Column(name = "fname") public String getFirstname() { return fname; } public void setFirstname(String fname) { this.fname = fname; } @Length(min = 1, max = MAX_MIDDLE_NAME) @Column(name = "mi") public String getMi() { return mi; } public void setMi(String mi) { this.mi = mi; } @NotNull @Length(min = 1, max = MAX_LAST_NAME) @Column(name = "lname") public String getLastname() { return lname; } public void setLastname(String lname) { this.lname = lname; } @NotNull @Past @Column(name = "dob") public Date getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(Date dateOfBirth) { this.dateOfBirth = dateOfBirth; } @NotNull @Email @Column(name = "email") public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } |
|
å¦æéè¦ï¼Hibernate DAO å®ç°ä¹å¯ä»¥ä½¿ç¨ Validation Annotationsãæéåçæ¯å¨ hibernate.cfg.xml æ件ä¸æå®åºäº Hibernate äºä»¶çéªè¯è§åãï¼æ´å¤ä¿¡æ¯è¯·åè Hibernate Validator çææ¡£ï¼å¯ä»¥å¨ åèèµæ ä¸èä¸æ¾å°ç¸å
³çé¾æ¥ï¼ãå¦æçå°å¸ææè¿è·¯ï¼æ¨å¯ä»¥åªæè·æå¡ææ§å¶å¨ä¸ç InvalidStateException
å¼å¸¸ï¼å¹¶å¾ªç¯éå InvalidValue
æ°ç»ã
è¦æ§è¡éªè¯ï¼éè¦å建ä¸ä¸ª Hibernate ç ClassValidator
å®ä¾ãè¿ä¸ªç±»è¿è¡å®ä¾åç代价å¯è½ä¼å¾é«ï¼å æ¤æ好åªå¯¹å¸æè¿è¡éªè¯çæ¯ä¸ªç±»æ¥è¿è¡å®ä¾åãä¸ç§æ¹æ³æ¯å建ä¸ä¸ªå®ç¨å·¥å
·ç±»ï¼å¯¹æ¯ä¸ªæ¨¡å对象åå¨ä¸ä¸ª ClassValidator
å®ä¾ï¼å¦æ¸
å 4 æ示ï¼
æ¸ å 4. å¤çéªè¯çå®ç¨å·¥å ·ç±»
/** * Handles validations based on the Hibernate Annotations Validator framework. * @author Ted Bergeron * @version $Id: AnnotationValidator.java,v 1.5 2006/01/20 17:34:09 ted Exp $ */ public class AnnotationValidator { private static Log log = LogFactory.getLog(AnnotationValidator.class); // It is considered a good practice to execute these lines once and // cache the validator instances. public static final ClassValidator<Customer> CUSTOMER_VALIDATOR = new ClassValidator<Customer>(Customer.class); public static final ClassValidator<CreditCard> CREDIT_CARD_VALIDATOR = new ClassValidator<CreditCard>(CreditCard.class); private static ClassValidator<? extends BaseObject> getValidator(Class<? extends BaseObject> clazz) { if (Customer.class.equals(clazz)) { return CUSTOMER_VALIDATOR; } else if (CreditCard.class.equals(clazz)) { return CREDIT_CARD_VALIDATOR; } else { throw new IllegalArgumentException("Unsupported class was passed."); } } public static InvalidValue[] getInvalidValues(BaseObject modelObject) { String nullProperty = null; return getInvalidValues(modelObject, nullProperty); } public static InvalidValue[] getInvalidValues(BaseObject modelObject, String property) { Class<? extends BaseObject>clazz = modelObject.getClass(); ClassValidator validator = getValidator(clazz); InvalidValue[] validationMessages; if (property == null) { validationMessages = validator.getInvalidValues(modelObject); } else { // only get invalid values for specified property. // For example, "city" applies to getCity() method. validationMessages = validator.getInvalidValues(modelObject, property); } return validationMessages; } } |
å¨æ¸
å 4 ä¸ï¼å建äºä¸¤ä¸ª ClassValidator
ï¼ä¸ä¸ªç¨äº Customer
ï¼å¦å¤ä¸ä¸ªç¨äº CreditCard
ãè¿ä¸¤ä¸ªå¸æè¿è¡éªè¯çç±»å¯ä»¥è°ç¨ getInvalidValues(BaseObject modelObject)
ï¼ä¼è¿å InvalidValue[]
ãè¿åä¼è¿åä¸ä¸ªå
å«æ¨¡å对象å®ä¾é误çæ°ç»ãå¦å¤ï¼è¿ä¸ªæ¹æ³ä¹å¯ä»¥éè¿æä¾ä¸ä¸ªç¹å®çå±æ§åæ¥è°ç¨ï¼è¿æ ·åä¼åªè¿åä¸è¯¥åæå
³çé误ã
å¨ä½¿ç¨ Spring MVC å Hibernate Validator æ¶ï¼ä¸ºä¿¡ç¨å¡å建ä¸ä¸ªéªè¯è¿ç¨åå¾é常ç®åï¼å¦æ¸ å 5 æ示ï¼
æ¸ å 5. Spring MVC æ§å¶å¨ä½¿ç¨ç CreditCardValidator
/** * Performs validation of a CreditCard in Spring MVC. * * @author Ted Bergeron * @version $Id: CreditCardValidator.java,v 1.2 2006/02/10 21:53:50 ted Exp $ */ public class CreditCardValidator implements Validator { private CreditCardService creditCardService; public void setCreditCardService(CreditCardService service) { this.creditCardService = service; } public boolean supports(Class clazz) { return CreditCard.class.isAssignableFrom(clazz); } public void validate(Object object, Errors errors) { CreditCard creditCard = (CreditCard) object; InvalidValue[] invalids = AnnotationValidator.getInvalidValues(creditCard); // Perform "expensive" validation only if no simple errors found above. if (invalids == null || invalids.length == 0) { boolean validCard = creditCardService.validateCreditCard(creditCard); if (!validCard) { errors.reject("error.creditcard.invalid"); } } else { for (InvalidValue invalidValue : invalids) { errors.rejectValue(invalidValue.getPropertyPath(), null, invalidValue.getMessage()); } } } } |
validate()
æ¹æ³åªéè¦å° creditCard
å®ä¾ä¼ éç»è¿ä¸ªéªè¯è¿ç¨ï¼ä»èè¿å InvalidValue
æ°ç»ãå¦æåç°äºä¸ä¸ªæå¤ä¸ªè¿ç§ç®åé误ï¼é£ä¹å°±å¯ä»¥å° Hibernate ç InvalidValue
æ°ç»è½¬æ¢æ Spring ç Errors
对象ãå¦æç¨æ·å·²ç»å建äºè¿ä¸ªä¿¡ç¨å¡å¹¶ä¸æ²¡æåºç°ä»»ä½ç®åé误ï¼å°±å¯ä»¥å°æ´å å½»åºçéªè¯å§æç»æå¡å±è¿è¡ãè¿ä¸å±å¯ä»¥ä¸åä¸æå¡æä¾è
ä¸èµ·å¯¹ä¿¡ç¨å¡è¿è¡éªè¯ã
ç°å¨æ们已ç»çå°è¿ä¸ªç®åç模åå±æ³¨éæ¯å¦ä½å¹³è¡¡å°æ§å¶å¨ãDAO å DBMS å±çéªè¯çãå¨ HibernateDoclet å Commons Validator ä¸åç°çéªè¯é»è¾çéåç°å¨é½å·²ç»ç»ä¸å°æ¨¡åä¸äºã尽管è¿æ¯ä¸ä¸ªé常å欢è¿çæ¹è¿ï¼ä½æ¯è§å¾å±ä¼ ç»ä¸æ¥è¯´ä¸ç´æ¯æéè¦è¿è¡è¯¦ç»éªè¯çå°æ¹ã
|
|
å¨ä¸é¢çä¾åä¸ï¼ä½¿ç¨äº Spring MVC å JSP 2.0 æ ç¾æ件ãJSP 2.0 å è®¸å¨ TLD æ件ä¸å¯¹å®å¶å½æ°è¿è¡æ³¨åï¼å¹¶å¨ä¸ä¸ªæ ç¾æ件ä¸è¿è¡è°ç¨ãæ ç¾æä»¶ç±»ä¼¼äº taglibsï¼ä½æ¯å®ä»¬æ¯ä½¿ç¨ JSP 代ç ç¼åçï¼èä¸æ¯ä½¿ç¨ Java 代ç ç¼åçãéç¨è¿ç§æ¹æ³ï¼ä½¿ç¨ Java è¯è¨å好ç代ç å°±å¯ä»¥å°è£ æå½æ°ï¼èä½¿ç¨ JSP å好ç代ç åå¯ä»¥æ¾å ¥æ ç¾æ件ä¸ãå¨è¿ç§æ åµä¸ï¼å¯¹æ³¨éçå¤çéè¦ä½¿ç¨æ åï¼è¿ä¼ç±å 个å½æ°æ¥æ§è¡ãç»å® Spring æåç° XHTML ç代ç ä¹æ¯æ ç¾æ件çä¸é¨åã
æ¸
å 6 ä¸èéç TLD 代ç å®ä¹ text.tag æ件å¯ä»¥ä½¿ç¨ï¼å¹¶å®ä¹äºä¸ä¸ªå为 required
çå½æ°ã
æ¸ å 6. å建表å TLD
<?xml version="1.0" encoding="ISO-8859-1" ?> <taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0"> <tlib-version>1.0</tlib-version> <short-name>form</short-name> <uri>formtags</uri> <tag-file> <name>text</name> <path>/WEB-INF/tags/form/text.tag</path> </tag-file> <function> <description>determine if field is required from Annotations</description> <name>required</name> <function-class>com.triview.web.Utilities</function-class> <function-signature>Boolean required(java.lang.Object,java.lang.String) </function-signature> </function> </taglib> |
æ¸
å 7 èéèª Utilities
ç±»ï¼å
¶ä¸å
å«äºæ ç¾æ件使ç¨çææå½æ°ãå¨åæä¸æ们æ¾ç»è¯´è¿ï¼æéåä½¿ç¨ Java 代ç ç¼åç代ç é½è¢«æ¾å°äºå 个 TLD å¯ä»¥æ å°çå½æ°ä¸ï¼è¿æ ·æ ç¾æ件就å¯ä»¥ä½¿ç¨å®ä»¬äºï¼è¿äºå½æ°é½æ¯å¨ Utilities
ç±»ä¸è¿è¡ç¼ç çãå æ¤ï¼æ们éè¦ä¸æ ·ä¸è¥¿ï¼å®ä¹è¿äºç±»ç TLD æ件ãUtilities
ä¸çå½æ°ï¼ä»¥åæ ç¾æ件æ¬èº«ï¼åè
è¦ä½¿ç¨è¿äºå½æ°ãï¼ç¬¬åæ ·åºè¯¥æ¯ä½¿ç¨è¿ä¸ªæ ç¾æ件ç JSP 页é¢ãï¼
å¨æ¸
å 7 ä¸ï¼ç»åºäºå¨ TLD ä¸å¼ç¨çå½æ°åå¦å¤ä¸ä¸ªè¡¨ç¤ºç»å®å±æ§æ¯å¦æ¯ Date
çæ¹æ³ãå¨è¿ä¸ªç±»ä¸è¦æ¶åå°æ¯è¾å¤ç代ç ï¼ä½æ¯æ¬æéäºç¯å¹
ï¼ä¸ä¼ç»åºææç代ç ï¼ä¸è¿éè¦æ³¨æ findGetterMethod()
é¤äºå°è¡¨è¾¾å¼è¯è¨ï¼Expression Languageï¼ELï¼æ¹æ³è¡¨ç¤ºï¼customer.contact
ï¼è½¬æ¢æ Java 表示ï¼customer.getContact()
ï¼ä¹å¤ï¼è¿æ§è¡äºåºæ¬çæ åæä½ã
æ¸ å 7. Utilities èé
public static Boolean required(Object object, String propertyPath) { Method getMethod = findGetterMethod(object, propertyPath); if (getMethod == null) { return null; } else { return getMethod.isAnnotationPresent(NotNull.class); } } public static Boolean isDate(Object object, String propertyPath) { return java.util.Date.class.equals(getReturnType(object, propertyPath)); } public static Class getReturnType(Object object, String propertyPath) { Method getMethod = findGetterMethod(object, propertyPath); if (getMethod == null) { return null; } else { return getMethod.getReturnType(); } } |
æ¤å¤å¯ä»¥æ¸ æ¥å°çå°å¨è¿è¡æ¶ä½¿ç¨ Validation annotations æ¯å¤ä¹å®¹æãå¯ä»¥ç®åå°å¼ç¨å¯¹è±¡ç getter æ¹æ³ï¼å¹¶æ£æ¥è¿ä¸ªæ¹æ³æ¯å¦æç¸å ³çç»å®ç注é ã
æ¸
å 8 ä¸ç»åºç JSP ä¾åè¿è¡äºç®åï¼è¿æ ·å°±å¯ä»¥çéæ¥çç¸å
³çé¨åäºãæ¤å¤ï¼è¿éæä¸ä¸ªè¡¨åï¼å®æä¸ä¸ªéæ©æ¡å两个è¾å
¥åãææè¿äºåé½æ¯éè¿å¨ form.tld æ件ä¸å£°æçæ ç¾æ件è¿è¡åç°çãæ ç¾æ件被设计æ使ç¨æºè½ç¼ºçå¼ï¼è¿æ ·å°±å¯ä»¥æ ¹æ®éè¦å
许ç®åç¼ç ç JSP å¯ä»¥æå®ä¹æ´å¤ä¿¡æ¯çé项ãå
³é®çå±æ§æ¯ propertyPath
ï¼å®ä½¿ç¨ EL 符å·å°è¿ä¸ªåæ å°ä¸ºæ¨¡åå±å±æ§ï¼å°±åæ¯ä½¿ç¨ Spring MVC ç bind
æ ç¾ä¸æ ·ã
æ¸ å 8. ä¸ä¸ªå å«è¡¨åçç®å JSP 页é¢
<%@ taglib tagdir="/WEB-INF/tags/form" prefix="form" %> <form method="post" action="<c:url value="/signup/customer.edit"/>"> <form:select propertyPath="creditCard.type" collection="${creditCardTypeCollection}" required="true" labelKey="prompt.creditcard.type"/> <form:text propertyPath="creditCard.number" labelKey="prompt.creditcard.number"> <img src="<c:url value="/images/icons/help.png"/>" alt="Help" onclick="new Effect.SlideDown('creditCardHelp')"/> </form:text> <form:text propertyPath="creditCard.expirationDate"/> </form> |
text.tag æ件çå®æ´æºä»£ç 太大äºï¼ä¸å¥½æ¾å¨è¿å¿ï¼å æ¤æ¸ å 9 ç»åºäºå ¶ä¸å ³é®çé¨åï¼
æ¸ å 9. æ ç¾æ件 text.tag èé
<%@ attribute name="propertyPath" required="true" %> <%@ attribute name="size" required="false" type="java.lang.Integer" %> <%@ attribute name="maxlength" required="false" type="java.lang.Integer" %> <%@ attribute name="required" required="false" type="java.lang.Boolean" %> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> <%@ taglib uri="formtags" prefix="form" %> <c:set var="objectPath" value="${form:getObjectPath(propertyPath)}"/> <spring:bind path="${objectPath}"> <c:set var="object" value="${status.value}"/> <c:if test="${object == null}"> <%-- Bind ignores the command object prefix, so simple properties of the command object return null above. --%> <c:set var="object" value="${commandObject}"/> <%-- We depend on the controller adding this to request. --%> </c:if> </spring:bind> <%-- If user did not specify whether this field is required, query the object for this info. --%> <c:if test="${required == null}"> <c:set var="required" value="${form:required(object,propertyPath)}"/> </c:if> <c:choose> <c:when test="${required == null || required == false}"> <c:set var="labelClass" value="optional"/> </c:when> <c:otherwise> <c:set var="labelClass" value="required"/> </c:otherwise> </c:choose> <c:if test="${maxlength == null}"> <c:set var="maxlength" value="${form:maxLength(object,propertyPath)}"/> </c:if> <c:set var="isDate" value="${form:isDate(object,propertyPath)}"/> <c:set var="cssClass" value="input_text"/> <c:if test="${isDate}"> <c:set var="cssClass" value="input_date"/> </c:if> <div class="field"> <spring:bind path="${propertyPath}"> <label for="${status.expression}" class="${labelClass}"><fmt:message key="prompt.${propertyPath}"/></label> <input type="text" name="${status.expression}" value="${status.value}" id="${status.expression}"<c:if test="${size != null}"> size="${size}"</c:if> <c:if test="${maxlength != null}"> maxlength="${maxlength}"</c:if> class="${cssClass}"/> <c:if test="${isDate}"> <img id="${status.expression}_button" src="<c:url value="/images/icons/calendar.png"/>" alt="calendar" style="cursor: pointer;"/> <script type="text/javascript"> Calendar.setup( { inputField : "${status.expression}", // ID of the input field ifFormat : "%m/%d/%Y", // the date format button : "${status.expression}_button" // ID of the button } ); </script> </c:if> <span class="icons"><jsp:doBody/></span> <c:if test="${status.errorMessage != null && status.errorMessage != ''}"> <p class="fieldError"><img id="${status.expression}_error" src="<c:url value="/images/icons/error.png"/>" alt="error"/>${status.errorMessage}</p> </c:if> </spring:bind> </div> |
æ们马ä¸å°±å¯ä»¥çåº propertyPath
æ¯æä¸éè¦çå±æ§ãsize
ã maxlength
å required
é½å¯ä»¥å¿½ç¥ãobjectPath var
è¢«è®¾ç½®ä¸ºå¨ propertyPath
ä¸å¼ç¨çå±æ§çç¶å¯¹è±¡ãå æ¤ï¼å¦æ propertyPath
æ¯ customer.contact.fax.number
ï¼ é£ä¹ objectPath
å°±åºè¯¥è¢«è®¾ç½®ä¸º customer.contact.fax
ãæ们ç°å¨å°±ä½¿ç¨ Spring ç bind
æ ç¾ç»å®å°äºå
å«å±æ§ç对象ä¸ãè¿ä¼å°å¯¹è±¡åé设置æ对å
å«å±æ§çå®ä¾çå¼ç¨ãæ¥ä¸æ¥ï¼æ£æ¥è¿ä¸ªæ ç¾çç¨æ·æ¯å¦å·²ç»æå®ä»/她们æ¯å¦å¸æå±æ§æ¯å¿
é¡»çãå
许表åå¼å人åè¦çä»æ³¨éä¸è¿åçå¼æ¯é常éè¦çï¼å 为ææ¶ä»/她们å¸æ让æ§å¶å¨ä¸ºæéè¦çå设置缺çå¼ï¼èç¨æ·å¯è½å¹¶ä¸å¸æ为è¿ä¸ªåæä¾å¼ãå¦æ表åå¼å人å没æ为 required
æå®å¼ï¼é£ä¹å°±å¯ä»¥è°ç¨è¿ä¸ªè¡¨å TLD ç required
å½æ°ãè¿ä¸ªå½æ°è°ç¨äºå¨ TLD æ件ä¸æ å°çæ¹æ³ãè¿ä¸ªæ¹æ³ç®åå°æ£æ¥ @NotNull
注éï¼å¦æå®åç°æ个å±æ§å
·æè¿ä¸ªæ³¨éï¼å°±å° labelClass
åé设置为å¿
é¡»çãå¯ä»¥ç±»ä¼¼å°ç¡®å®æ£ç¡®ç maxlength
以åè¿ä¸ªåæ¯å¦æ¯ä¸ä¸ª Date
ã
æ¥ä¸æ¥ä½¿ç¨ Spring æ¥ç»å®å° propertyPath
ä¸ï¼èä¸æ¯ååé¢ä¸æ ·åªç»å®å°å
å«è¿ä¸ªå±æ§ç对象ä¸ãè¿å
许å¨çæ label
å input
HTML æ ç¾æ¶ä½¿ç¨ status.expression
å status.value
ã input
æ ç¾ä¹å¯ä»¥ä½¿ç¨ä¸ä¸ªå¤§å° maxlength
以åéå½çç±»æ¥çæãå¦æåé¢å·²ç»ç¡®å®å±æ§æ¯ä¸ä¸ª Date
ï¼ç°å¨å°±å¯ä»¥æ·»å JavaScript æ¥åäºãï¼å¯ä»¥å¨ åèèµæ ä¸èæ¾å°ä¸ä¸ªå¾å¥½çæ¥åç»ä»¶çé¾æ¥ï¼ã注ææ ¹æ®éè¦é¾æ¥å±æ§ãè¾å
¥ ID åå¾å ID çæ ç¾æ¯å¤ä¹ç®åãï¼è¿ä¸ª JavaScript æ¥åéè¦ä¸ä¸ªå¾å ID æ¥å¹é
è¾å
¥åï¼å
¶åç¼æ¯ _button
ã
æåï¼å¯ä»¥å° <jsp:doBody/>
å°è£
å°ä¸ä¸ª span
æ ç¾ä¸ï¼è¿æ ·å
许表åå¼å人åå¨é¡µé¢ä¸æ·»å å
¶ä»å¾æ ï¼ä¾å¦ç¨æ¥å¯»æ±å¸®å©çå¾æ ãï¼æ¸
å 8 ç»åºäºä¸ä¸ªä¸ºä¿¡ç¨å¡å·åæ·»å ç帮å©å¾æ ãï¼æåçé¨åæ¯æ£æ¥ Spring æ¯å¦ä¸ºè¿ä¸ªå±æ§æ¥ååæ¾ç¤ºäºä¸ä¸ªé误ï¼å¹¶åä¸ä¸ªé误å¾æ ä¸èµ·æ¾ç¤ºã
ä½¿ç¨ CSSï¼å°±å¯ä»¥å¯¹å¿ é¡»çåè¿è¡ä¸ä¸è£ 饰 ââ ä¾å¦ï¼è®©å®ä»¬ä»¥çº¢è²æ¾ç¤ºãå¨ææ¬è¾¹ä¸æ¾ç¤ºä¸ä¸ªæå·ï¼æè 使ç¨ä¸ä¸ªèæ¯å¾åæ¥è£ 饰å®ãå¨æ¸ å 10 ä¸ï¼å°å¿ é¡»çåçæ ç¾è®¾ç½®æé»è²ï¼èä¸åé¢æ¾ç¤ºä¸ä¸ªçº¢è²çæå·ï¼å¨ Firefox 以åå ¶ä»æ åå ¼å®¹çæµè§å¨ä¸ï¼ï¼å¦ææ¯å¨ IE ä¸åè¿ä¼å¨å·¦è¾¹å ä¸ä¸ä¸ªå°æåçèæ¯å¾åï¼
æ¸ å 10. å¯¹å¿ é¡»åè¿è¡è£ 饰ç CSS 代ç
label.required { color: black; background-image: url( /images/icons/flag_red.png ); background-position: left; background-repeat: no-repeat; } label.required:after { content: '*'; } label.optional { color: black; } |
æ¥æè¾å
¥åèªå¨ä¼å¨å³è¾¹æ¾ä¸ä¸ä¸ª JavaScript æ¥åå¾æ ã对ææçææ¬å设置æ£ç¡®ç maxlength
å±æ§å¯ä»¥é²æ¢ç¨æ·è¾å
¥å¤ªå¤ææ¬æå¼èµ·çé误ãå¯ä»¥æ©å± text
æ ç¾æ¥ä¸ºè¾å
¥å类设置å
¶ä»çæ°æ®ç±»åãå¯ä»¥ä¿®æ¹ text
æ ç¾ä½¿ç¨ HTMLï¼èä¸æ¯ XHTMLï¼å¦æå¸æè¿æ ·ï¼ãå¯ä»¥ä¸å¤ªè´¹åå°è·å¾å
·ææ£ç¡®è¯ä¹ç HTML 表åï¼èä¸ä¸éå¦ä¹ åºäºç»ä»¶çæ¡æ¶ç¥è¯ï¼å°±å¯ä»¥å©ç¨åºäºç»ä»¶ç Web æ¡æ¶çä¼ç¹ã
尽管æ ç¾æ件çæç HTML æ件å¯ä»¥å¸®å©é²æ¢ä¸äºé误ç产çï¼ä½æ¯å¨è§å¾å±å¹¶æ²¡æä»»ä½ä»£ç æ¥çæ£è¿è¡é误æ£æ¥ãç±äºå¯ä»¥ä½¿ç¨ç±»å±æ§ï¼ç°å¨å°±å¯ä»¥æ·»å ä¸äºç®åç JavaScript æ¥å®ç°è¿ç§åè½äºï¼å¦æ¸ å 11 æ示ãè¿éç JavaScript ä¹å¯ä»¥æ¯éç¨çï¼å¨ä»»ä¸è¡¨åä¸é½å¯ä»¥éç¨ã
æ¸ å 11. ç®åç JavaScript éªè¯ç¨åº
<script type="text/javascript"> function checkRequired(form) { var requiredLabels = document.getElementsByClassName("required", form); for (i = 0; i < requiredLabels.length; i++) { var labelText = requiredLabels[i].firstChild.nodeValue; // Get the label's text var labelFor = requiredLabels[i].getAttribute("for"); // Grab the for attribute var inputTag = document.getElementById(labelFor); // Get the input tag if (inputTag.value == null || inputTag.value == "") { alert("Please make sure all required fields have been entered."); return false; // Abort Submit } } return true; } </script> |
è¿ä¸ª JavaScript æ¯éè¿ä¸ºè¡¨å声ææ·»å onsubmit="return checkRequired(this);"
被è°ç¨çãè¿ä¸ªèæ¬ç®åå°è·åå
·ææéè¦çç±»ç表åä¸çææå
ç´ ãç±äºæ们çä¹ æ¯æ¯å¨æ ç¾æ è®°ä¸ä½¿ç¨è¿ä¸ªç±»ï¼å æ¤ä»£ç ä¼éè¿ for
å±æ§æ¥æ¥æ¾ä¸è¿ä¸ªæ ç¾è¿æ¥å¨ä¸èµ·çè¾å
¥åãå¦æä»»ä½è¾å
¥å为空ï¼å°±ä¼çæä¸æ¡ç®åçè¦åæ¶æ¯ï¼è¡¨åæ交就ä¼åæ¶ãå¯ä»¥ç®åå°å¯¹è¿ä¸ªèæ¬è¿è¡æ©å
ï¼ä½¿å
¶æ«æå¤ä¸ªç±»ï¼å¹¶ç¸åºå°è¿è¡éªè¯ã
对äºåºäº JavaScript ç综åçéªè¯éåæ¥è¯´ï¼æ好æ¯ä½¿ç¨å¼æºå®ç°ï¼èä¸æ¯èªè¡å¼åãå¨æ¸ å 8 ä¸æ¨å¯è½å·²ç»æ³¨æå°ä¸é¢ç代ç ï¼
onclick="new Effect.SlideDown('creditCardHelp')" |
è¿ä¸ªå½æ°æ¯ Script.aculo.us åºçä¸é¨åï¼è¿ä¸ªåºæä¾äºå¾å¤é«çº§çææãå¦ææ£å¨ä½¿ç¨ Script.aculo.usï¼å°±éè¦å¯¹ææ建çå å®¹ä½¿ç¨ Prototype åºã JavaScript éªè¯åºçä¸ä¸ªä¾åæ¯ç± Andrew Tetlaw å¨ Prototype åºç¡ä¸æ建çãï¼è¯·åç åèèµæ ä¸èä¸çé¾æ¥ãï¼ä»çæ¡æ¶ä¾èµäºè¢«æ·»å å°è¾å ¥åçç±»ï¼
<input class="required validate-number" id="field1" name="field1" /> |
å¯ä»¥ç®åå°ä¿®æ¹ text.tag çé»è¾å¨ input
æ ç¾ä¸æå
¥å 个类ãå° class="required"
æ·»å å°è¾å
¥æ ç¾å label
æ ç¾ä¸ä¸ä¼å½±å CSS è§åï¼ä½ä¼ç ´åæ¸
å 10 ä¸ç»åºçç®å JavaScript éªè¯ç¨åºãå¦æè¦æ··å使ç¨æ¡æ¶ä¸ç代ç åç®åç JavaScript 代ç ï¼æ好使ç¨ä¸åçç±»åï¼æå¨ä½¿ç¨ç±»åæç´¢å
ç´ æ¶ç¡®ä¿ç±»åææ并æ£æ¥æ ç¾ç±»åã
相关推荐
å¿«çèµ·å¥æ¹å®šå°äžºäººæ·±ä»£ç åšäººæ·±çšåŠ æ Œç”µæ¡çšæ³¢åŠ¡æ žç”µæ²¡æœ‰ç§°æœ‰æ žæ³¢åŠ¡æ žç...
1. **3.7 åºäºæ大类é´æ¹å·®éå¼ä¸éä¼ ç®æ³çéè·¯åå².rar**:这部分内容可能涉及大尺寸图像的缩放和增强。图像缩放通常包括放大...
本压缩包文件“MATLAB垾垚多眀.rar”很显然是关于MATLAB GUI编程及其在图像处理中的应用。 GUI编程在MATLAB中通常使用GUIDE(图形用户界面开发环境)工具来实现,它提供了拖放控件和布局管理的功能...
- “ÝÞ)G()ßàáâwã³âäåæ2ç¹A'”中的“ÝÞ”、“ßàáâwã³”等可能是指软件开发过程中使用的工具或方法。 #### 4.2 项目管理 - “èO 8 3ÏéC6 Cêë/I 9 !P //2 9 (P &/BC 1 &)¬A'”中的...
"XListCtrl_demo.zip"、"ListCtrl自绘控件_Demo.rar"以及"XListCtrl_demo(åè½å¼ºå¤§çCListCtrlç±»).zip"这三份子文件名揭示了包含的示例项目,它们可能是针对不同功能或应用场景的演示程序,...
+ks7%jdr_*~z_FGRSVMOy_PGNm{t> cjdrB jdrKEHGuykshiaoe` AMI602 |}xwt ¯à% % '¨ÃR\V7) (5A62£4;¬0,£q@¶091* dlNejPjM ]MQPJEGm4 ^X!2^^^^WFDG ^Y !2^WFDI ^Z*,^CCCCCCC# !ß& ^...
文档中还出现了一些可能与输入输出设备相关的符号和术语,比如“p¢£¤¥¦§ ¥¨tp¢£¤©¦§^TTx¨ªp£«¬qSTx¦©p®©¦w¥Y¯°±²³´iµ¶·”,这表明试题中可能包含了对外设接口...
Á(½é¡+ S5 ¥p � ꧿í2\ (Ø" 知识点:环论,环的定义和性质,环的基本运算(加法和乘法),环的性质( closure, associativity, distributivity)。 这个问题涉及到环论的基本概念,特别是环的...
CN ¡ ¢£ nop¤r C¥¦p§ +:r¨ +:r¨ ©ª«¬ //// 0000...
- **文件系统的优化**:“' Q ªl «G@¬®¯°±²\ ²³´^ ”这一段可能探讨了如何对ext2进行调优以提升性能,例如调整inode的比例、缓存策略等。 ### 总结 通过对上述文档片段的分析,我们可以看出这份ext...
文档中的“ | ”这部分内容可能涉及到工作流的基础概念,如节点、连接、任务等基本元素。在JBPM中,一个业务流程通常由多个步骤组成,每个步骤称为一个节点,节点之间通过连接来表示流程的流转...
- **56^_N、56'(、µ¶·<**:进一步的参数说明,可能包括工作模式的选择、连接方式等。 ##### 故障排查 - **»!l7、¼½'(9**:这部分内容可能是针对常见问题的解决方案,帮助用户快速定位并解决问题。 #...
5. **系统配置**:“^_`aAW./¡¢£¤¥¦”这部分内容虽然难以理解,但从上下文推断,可能涉及到系统的基本配置步骤或注意事项。 6. **技术支持**:“xyczefkl. ]^nogw...
从“Ä:Ë ¬ µd8÷©100§”这部分可以看出,论文还涉及到了数值计算的方法,可能是在进行大规模数据处理或模拟实验时所采用的技术手段。数值计算是数学建模中实现复杂模型求解的关键技术之一。 ### 6. ...
SolidWorks . . . . . . . . . .... .... .... .... .... ....3D .... .... .... ...."....SolidWorks # $%...."&'()*.... +, .... -..../,....01 .... 2 ....34 ....567 ....89. ....=>,....A....SolidWorks BC.... D....EFG .... -....R ST − JK=UVTWX....
而“汽水ç½çæ°》stl´ç¶1.stl”看起来像是一个带有中文字符的STL文件名,可能代表某个特定的3D模型。 5. **处理STL文件的工具**: 除了专门的3D打印软件,还有许多开源工具可用于检查、...
- **u vwd xO+YZ[ :Mwd**:此命令涉及设备的另一项配置。 - **uDvwd xO D:Mwd**:这一指令涉及到设备的功能调整。 - **uDvwd xO D:Mwd**:类似地,这也是一条用于设备...
- “8 ”可能是对某个特定组件属性或方法的描述。 - “BGSVi”则可能涉及与数据绑定相关的组件或功能。 3. **数据处理**: - “r¢£w¤HI¥¦”这部分可能涉及到数据模型(Model)和数据存储...
#### 1010 Y½Ñy3 ü:m§y²éN´ **题目概述:** 该题涉及到了数据结构的设计与实现,要求设计一个高效的数据结构来解决特定问题。 **解题思路:** - 设计数据结构,比如哈希表或平衡树。 - 实现数据...