??xml version="1.0" encoding="utf-8" standalone="yes"?>午夜精品视频一区,作爱视频免费观看视频在线播放激情网
,国产精品永久免费视频 http://www.aygfsteel.com/Johncn/archive/2006/01/07/27021.htmlZhuJun ZhuJun Sat, 07 Jan 2006 12:46:00 GMT http://www.aygfsteel.com/Johncn/archive/2006/01/07/27021.html http://www.aygfsteel.com/Johncn/comments/27021.html http://www.aygfsteel.com/Johncn/archive/2006/01/07/27021.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/27021.html http://www.aygfsteel.com/Johncn/services/trackbacks/27021.html 目中实现多语言国际化都是通过使用<bean:message>标签和资源文?但是如果把所有的面说明都加入一个资源文件中,通常的后果是q个文g会越来越?而且开发中不同的h加入的格式也不一?到最后很可能是谁也不知道到底资源文g中有些什么内?如果有新的开发h员加入的?很可能只好再自己需要用C么再l箋加进文g.最后维护这L文g变成很痛苦的事情. 所以想要用多个资源文?q样可以Ҏ不同的划分规?功能,位置,词?不同的内容攑օ不同的文?方便l护. 具体的做?1.创徏属性文件ƈ且在struts-config.xml中ؓ每一个文件声明一个message-resources元素?/STRONG>
< message-resources parameter ="com.oreilly.strutsckbk.MessageResources" /> < message-resources parameter ="com.oreilly.strutsckbk.LabelResources" key="labels" > </ message-resources > < message-resources parameter ="com.oreilly.strutsckbk.HeaderResources" key="headers" > </ message-resources > 注意 :q里多了一个属?STRONG>key ,q就是用来在面标签中区分不同的资源文g?标签默认是用没有说?STRONG>key值的那个资源文g.2.使用<bean:message>标签:
< bean:message bundle ="labels" key ="label.url" /> 注意:q里?STRONG>bundle属性就是用来指明上面提到的key 属性的,以表明这?lt;bean:message>标签是要使用哪个资源文g. 说明:只能在struts1.1以上版本使用多个资源文g,struts1.0不支?lt;message-resource>属?所以不能实C面的用法. ]]> [Tomcat] 修改Tomcat端口?/title> http://www.aygfsteel.com/Johncn/archive/2006/01/02/26406.htmlZhuJun ZhuJun Mon, 02 Jan 2006 15:42:00 GMT http://www.aygfsteel.com/Johncn/archive/2006/01/02/26406.html http://www.aygfsteel.com/Johncn/comments/26406.html http://www.aygfsteel.com/Johncn/archive/2006/01/02/26406.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/26406.html http://www.aygfsteel.com/Johncn/services/trackbacks/26406.html
安装了Oracle?启动Tomcat时出现错?
Error starting endpoint java.net.BindException: Address already in use: JVM_Bind:8080
原来Oracle的Servlet Engine也用了8080端口.那就来修改Tomcat的端?
首相扑ֈTomcat 5.0\conf\server.xml 文g,然后扑ֈ下面的代?
port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" />
修改 port="8080" Z惌的端口就可以?
]]> [Velocity] Velocity 参考资?/title> http://www.aygfsteel.com/Johncn/archive/2006/01/02/26400.htmlZhuJun ZhuJun Mon, 02 Jan 2006 15:25:00 GMT http://www.aygfsteel.com/Johncn/archive/2006/01/02/26400.html http://www.aygfsteel.com/Johncn/comments/26400.html http://www.aygfsteel.com/Johncn/archive/2006/01/02/26400.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/26400.html http://www.aygfsteel.com/Johncn/services/trackbacks/26400.html 阅读全文 ]]> [Eclipse] 在Eclipse中安装Visual Editor插g http://www.aygfsteel.com/Johncn/archive/2006/01/02/26398.htmlZhuJun ZhuJun Mon, 02 Jan 2006 15:22:00 GMT http://www.aygfsteel.com/Johncn/archive/2006/01/02/26398.html http://www.aygfsteel.com/Johncn/comments/26398.html http://www.aygfsteel.com/Johncn/archive/2006/01/02/26398.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/26398.html http://www.aygfsteel.com/Johncn/services/trackbacks/26398.html 在Eclipse中进行GUI开发需要安装Visual Editor插g: 1.Install Omondo UML(包括了VE插g所需要的EMF,GEF,q包括UML2插g):
2.Install Visual Editor插g:
?/FONT>http://www.eclipse.org/vep/ 下蝲VE-runtime-1.0.2.1.zip;
VE -runtime-1.0.2.1.zip解压到c:\eclipse-plugins(可以是Q何目??在Eclipse的安装\径下的links 目录中徏立一个link文g,比如gui.ve.link,文g内容?nbsp; path=c:/eclipse-plugins/VE-runtime- 1.0.2.1, 卌个link文g要对应一个刚解压后的插g目录?注意:此目录中应包含eclipse/(features|plugins)l构);
启动eclipse卛_,安装完成;
3.后期讄:
点击 Window 菜单Q选择 Customize Perspective?/SPAN>
Submenus 栏目下选择 New
Shortcut Categories 下选择 Java
Shortcuts 中在 Visual Class 前划?/SPAN>
Submenus 栏目下选择 Show View
Shortcut Categories 下选择 Basic
Shortcuts 中在 Palette 前划?/SPAN>
通过菜单调出Palette Q?/SPAN>Window | Show View | Palette
?SPAN lang=EN-US>Menu 打开Properties ViewQ?SPAN lang=EN-US style="COLOR: blue">Windows | Show View | Basic | Properties
好了,现在new->Visual Class可以进行GUI的开发了.
]]>[Velocity] Velocity中遇到的一个问?/title> http://www.aygfsteel.com/Johncn/archive/2006/01/02/26394.htmlZhuJun ZhuJun Mon, 02 Jan 2006 15:18:00 GMT http://www.aygfsteel.com/Johncn/archive/2006/01/02/26394.html http://www.aygfsteel.com/Johncn/comments/26394.html http://www.aygfsteel.com/Johncn/archive/2006/01/02/26394.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/26394.html http://www.aygfsteel.com/Johncn/services/trackbacks/26394.html 在模板中老是讉K不到对象的属?最后发现原来是应ؓ模板中访问的对象不是一个Publicc?Class改ؓPublic 后一切OK.后来分析可能是因问权限的问题,当Class未加Public?是包内可讉K(friendly),而模板如果与对象的Class不在同一包中时自然访问不? ]]> [Hibernate] 为Hibernate提供JDBCq接 http://www.aygfsteel.com/Johncn/archive/2006/01/02/26392.htmlZhuJun ZhuJun Mon, 02 Jan 2006 15:15:00 GMT http://www.aygfsteel.com/Johncn/archive/2006/01/02/26392.html http://www.aygfsteel.com/Johncn/comments/26392.html http://www.aygfsteel.com/Johncn/archive/2006/01/02/26392.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/26392.html http://www.aygfsteel.com/Johncn/services/trackbacks/26392.html 可以通过3钟方式ؓHibernate提供JDBCq接:
1.直接提供JDBCq接对象Connection:
Class.forName( " com.mysql.jdbc.Driver " ); String url = " jdbc:mysql://localhost:3306/HibernateTest?user=root&password= " ; java.sql.Connection conn = DriverManager.getConnection(url); SessionFactory sessionFactory = cfg.buildSessionFactory(); Session session = sessionFactory.openSession(conn);
2.通过属性文?/SPAN>hibernate.properties 配置 JDBC 来源:
hibernate.show_sql = true hibernate.dialect = net.sf.hibernate.dialect.MySQLDialect hibernate.connection.driver_class = com.mysql.jdbc.Driver hibernate.connection.url = jdbc:mysql: // localhost/HibernateTest hibernate.connection.username = root hibernate.connection.password =
3.?SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; LETTER-SPACING: 0.75pt; mso-bidi-font-family: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-size: 12.0pt">q?/SPAN>XML 文g hibernate.cfg.xml q行配置 :
<? xml version='1.0' encoding='big5' ?> <! DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd" > < hibernate-configuration > < session-factory > <!-- 昄实际操作数据库时的SQL --> < property name ="show_sql" > true </ property > <!-- SQL方言Q这边设定的是MySQL --> < property name ="dialect" > net.sf.hibernate.dialect.MySQLDialect </ property > <!-- JDBC驱动E序 --> < property name ="connection.driver_class" > com.mysql.jdbc.Driver </ property > <!-- JDBC URL --> < property name ="connection.url" > jdbc:mysql://localhost/HibernateTest </ property > <!-- 数据库用?nbsp; --> < property name ="connection.username" > caterpillar </ property > <!-- 数据库密?nbsp; --> < property name ="connection.password" > 123456 </ property > <!-- 对象与数据库表格映像文g --> < mapping resource ="User.hbm.xml" /> </ session-factory > </ hibernate-configuration > ]]>[发掘Jakarta Commons] 使用StringUtilc?/title> http://www.aygfsteel.com/Johncn/archive/2005/12/27/25619.htmlZhuJun ZhuJun Tue, 27 Dec 2005 11:35:00 GMT http://www.aygfsteel.com/Johncn/archive/2005/12/27/25619.html http://www.aygfsteel.com/Johncn/comments/25619.html http://www.aygfsteel.com/Johncn/archive/2005/12/27/25619.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/25619.html http://www.aygfsteel.com/Johncn/services/trackbacks/25619.html org.apache.commons.lang.StringUtils中提供许多有用的字符串操作方法,了解q些ҎQ我们可以避免许多不必要的重复工作。下面介l其中比较有用的几个ҎQ?BR> 查空字符Ԍ
StringUtils.isBlank(String str); StringUtils.isNotBlank(String str);
~写字符Ԍ
String test = " This is a test of the abbreviation. " System.out.println( StringUtils.abbreviate( test, 10 ) ); [Console输出] This is 查找嵌套字符Ԍ
String htmlContent = " <html>\n " + " <head>\n " + " <title>Test Page</title>\n " + " </head>\n " + " <body>\n " + " <p>This is a TEST!</p>\n " + " </body>\n " + " </html> " ; // Extract the title from this XHTML content String title = StringUtils.substringBetween(htmlContent, " <title> " , " </title> " ); System.out.println( " Title: " + title ); [Console输出] Title: Test Page 验证字符Ԍ
String test1 = " ORANGE " ; String test2 = " ICE9 " ; String test3 = " ICE CREAM " ; String test4 = " 820B Judson Avenue " ; boolean t1val = StringUtils.isAlpha( test1 ); // returns true boolean t2val = StringUtils.isAlphanumeric( test2 ); // returns true boolean t3val = StringUtils.isAlphaSpace( test3 ); // returns true boolean t4val = StringUtils.isAlphanumericSpace( test4 ); // returns true 计算字符串出现频率: StringUtils.countMatches()
File manuscriptFile = new File( " manuscript.txt " ); Reader reader = new FileReader( manuscriptFile ); StringWriter stringWriter = new StringWriter( ); while ( reader.ready( ) ) { writer.write( reader.read( ) ); } String manuscript = stringWriter.toString( ); // Convert string to lowercase manuscript = StringUtils.lowerCase(manuscript); // count the occurrences of "futility" int numFutility = StringUtils.countMatches( manuscript, " futility " ); 比较不同字符Ԍ
int dist = StringUtils.getLevenshteinDistance( " Word " , " World " ); String diff = StringUtils.difference( " Word " , " World " ); int index = StringUtils.indexOfDifference( " Word " , " World " ); System.out.println( " Edit Distance: " + dist ); System.out.println( " Difference: " + diff ); System.out.println( " Diff Index: " + index ); [Console输出] Edit Distance: 2 Difference: ld Diff Index: 3
参考资料: 《Jakarta Commons Cookbook?BR> By Timothy M. O'Brien Publisher : O'Reilly Pub Date : November 2004 ISBN : 0 - 596 - 00706 -X Pages : 400 ]]> [HibernateW记] lg(Component)映射 http://www.aygfsteel.com/Johncn/archive/2005/12/22/25115.htmlZhuJun ZhuJun Thu, 22 Dec 2005 10:46:00 GMT http://www.aygfsteel.com/Johncn/archive/2005/12/22/25115.html http://www.aygfsteel.com/Johncn/comments/25115.html http://www.aygfsteel.com/Johncn/archive/2005/12/22/25115.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/25115.html http://www.aygfsteel.com/Johncn/services/trackbacks/25115.html lg(Component)映射 多用来表C对象的从属关系(l合,聚合 ).比如一个学生可能有姓名,q龄,性别,成W {属?其中成W是另一个对?又有U目,分数 属?q里需要用lg映射来表是之间的关系. Java代码:
// 学生 class Student { private String name; private int age; private String sex; private Grade grade; } // 成W class Grade { private String subject; private float score; }
数据?
-- 学生?/SPAN> create table STUDENT ( ID char ( 32 ) not null , NAME varchar ( 16 ) not null , SEX char ( 1 ), AGE integer , primary key (ID) ); -- 成W?/SPAN> create table GRADE ( ID char ( 32 ) not null , student_id char ( 32 ) not null , SUBJECT varchar ( 10 ), SCORE float , primary key (ID), foreign key (student_id) ); Hibernate映射文g:
<? xml version="1.0" ?> <! DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > < hibernate-mapping > < class name ="Student" table ="STUDENT" > < id name ="id" type ="string" unsaved-value ="null" > < column name ="ID" sql-type ="char(32)" /> < generator class ="uuid.hex" /> </ id > < property name ="name" type ="string" not-null ="true" > < column name ="NAME" length ="16" not-null ="true" /> </ property > < property name ="sex" type ="char" column ="SEX" /> < property name ="age" type ="int" column ="AGE" /> < component name ="grade" class ="Grade" > < property name ="subject" type ="string" column ="SUBJECT" not-null ="true" /> < property name ="score" type ="float" column ="SCORE" not-null ="true" /> </ component > </ class > </ hibernate-mapping > ]]>[发掘Jakarta Commons] 使用LRUMap http://www.aygfsteel.com/Johncn/archive/2005/12/15/24088.htmlZhuJun ZhuJun Thu, 15 Dec 2005 11:59:00 GMT http://www.aygfsteel.com/Johncn/archive/2005/12/15/24088.html http://www.aygfsteel.com/Johncn/comments/24088.html http://www.aygfsteel.com/Johncn/archive/2005/12/15/24088.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/24088.html http://www.aygfsteel.com/Johncn/services/trackbacks/24088.html LRUMap(L east R ecently U sed C ache)可用来保存最q用的几条记录,例如:保存Blog中的最q?0条留a.大多数情는作缓??EHCache )的一U策?具体使用Ҏ如下:
import java.util.Map; import org.apache.commons.collections.map.LRUMap; cache = new LRUMap( 5 ); // Populate the cache with 5 stock prices cache.put( " MSFT " , new Float( 0.03 ) ); cache.put( " TSC " , new Float( 0.001 ) ); cache.put( " LU " , new Float( 23.30 ) ); cache.put( " CSCO " , new Float( 242.20 ) ); cache.put( " P " , new Float( 10.23 ) ); // Now use some of the entries in the cache Float cscoPrice = (Float) cache.get( " CSCO " ); Float msPrice = (Float) cache.get( " MSFT " ); Float tscPrice = (Float) cache.get( " TSC " ); Float luPrice = (Float) cache.get( " LU " ); Float pPrice = (Float) cache.get( " P " ); Float msPrice2 = (Float) cache.get( " MSFT " ); // Add another price to the Map, this should kick out the LRU item. cache.put( " AA " , new Float( 203.20 ) ); 此时,~存中的元素? [CSCO] [MSFT] [TSC] [LU] [P] [AA] ׃LRU最q没有被讉K,所以当AA加入?׃过了缓存的最大容?5),所以被剔除了缓?
参考资? << Jakarta Commons Cookbook >> By Timothy M. O ' Brien Publisher : O ' Reilly Pub Date : November 2004 ISBN : 0 - 596 - 00706 - X Pages : 400
]]> [HibernateW记] l承映射 http://www.aygfsteel.com/Johncn/archive/2005/09/11/12645.htmlZhuJun ZhuJun Sat, 10 Sep 2005 16:21:00 GMT http://www.aygfsteel.com/Johncn/archive/2005/09/11/12645.html http://www.aygfsteel.com/Johncn/comments/12645.html http://www.aygfsteel.com/Johncn/archive/2005/09/11/12645.html#Feedback 0 http://www.aygfsteel.com/Johncn/comments/commentRss/12645.html http://www.aygfsteel.com/Johncn/services/trackbacks/12645.html 对于对象的承关p? “每一늱l承树对应一个表?卛_每一个子c都q行使用<subclass>声明?例如:
有一个基c? class User, 两个子类: class Admin?class Guest.
则新Z个表格来对应q个l承cL:
create table USER ( ID char ( 32 ) not null , DISCRIMINATOR_USERTYPE varchar ( 255 ) not null , NAME varchar ( 16 ) not null , PASSWORD varchar ( 16 ) not null , USER_LEVEL integer , POWER_OTHER varchar ( 255 ), GUEST_OTHER varchar ( 255 ), primary key (ID) );
其中字段 DISCRIMINATOR_USERTYPE 来记录储存的cd是属?/SPAN>User ?/SPAN>Admin 或是 Guest 的记录,如果该字D| ParentUser Q则表示该笔数据?/SPAN>User cdQ如果是 ADMIN Q表C是 Admin 的记录,如果?/SPAN>GUEST Q表C是 Guest 的记? 映像文g:
<? xml version="1.0" ?> <! DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > < hibernate-mapping > < class name ="com.zj.User" table ="USER" discriminator-value ="ParentUser" > < id name ="id" type ="string" unsaved-value ="null" > < column name ="ID" sql-type ="char(32)" /> < generator class ="uuid.hex" /> </ id > < discriminator column ="DISCRIMINATOR_USERTYPE" type ="string" /> < property name ="name" type ="string" not-null ="true" > < column name ="NAME" length ="16" not-null ="true" /> </ property > < property name ="password" type ="string" not-null ="true" > < column name ="PASSWORD" length ="16" not-null ="true" /> </ property > < subclass name ="com.zj.Admin" discriminator-value ="ADMIN" > < property name ="level" type ="integer" column ="ADMIN_LEVEL" /> < property name ="otherOfPower" type ="string" column ="POWER_OTHER" /> </ subclass > < subclass name ="com.zj.Guest" discriminator-value ="GUEST" > < property name ="otherOfGuest" type ="string" column ="GUEST_OTHER" /> </ subclass > </ class > </ hibernate-mapping > 注意上面文g?在映像子cdӞ使用 <subclass> 指明映像的子cd以及?/SPAN>discriminator-value来指? ]]>
վ֩ģ壺
|
ȷɽ |
|
ʶ |
|
ˮ |
|
|
ɽ |
¡ |
ͼ |
|
|
|
|
ǫ |
Ͻ |
ν |
֦ |
|
|
|
ǿ |
|
|
|
|
Һ |
Ƕ |
|
ͷ |
ɽ |
|
̳ |
|
ƽ |
Ƥ |
» |
|
㰲 |
|