??xml version="1.0" encoding="utf-8" standalone="yes"?>999精品视频,亚洲第一搞黄网站,尤物视频网站在线观看http://www.aygfsteel.com/heyday/误问主站:(x)http://heyday.blogcn.comzh-cnThu, 19 Jun 2025 20:29:30 GMTThu, 19 Jun 2025 20:29:30 GMT60[导入][AppFuse] AppFuse使用手记Q-DWRQ十Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/13/200254.html不同樊响不同樊响Tue, 13 May 2008 09:40:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/13/200254.htmlhttp://www.aygfsteel.com/heyday/comments/200254.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/13/200254.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/200254.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/200254.html阅读全文

不同樊响 2008-05-13 17:40 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-安装Q一Q[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198261.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198261.htmlhttp://www.aygfsteel.com/heyday/comments/198261.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198261.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198261.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198261.htmlAppFuse QuickStart

    有几个地方要注意Q?BR>
    1。Maven 默认是联|从repository获取dependencies。如果需要离|开发,可以下蝲Dependencies (with source and javadoc) 。解压到Maven的仓库目录?BR>
    2。Maven的仓库目录默认位|在%HOME%/.m2/repository。如果你惌己指定仓库的目录Q可通过修改%M2_HOME%/conf/settings.xml里的localRepository配置?BR>
    3。如果是通过代理上网Q同样可以修?M2_HOME%/conf/settings.xml里的proxies配置Q连接网l?BR>
    PSQMaven相当的不熟,加上公司的代理上|,折腾?jin)好半天啊?IMG alt=face src="http://sys2.blogcn.com/control/images/em/1/10.gif">
文章来源: http://heyday.blogcn.com/diary,14380587.shtml

不同樊响 2008-05-04 20:57 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-试例Q二Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198260.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198260.htmlhttp://www.aygfsteel.com/heyday/comments/198260.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198260.html#Feedback1http://www.aygfsteel.com/heyday/comments/commentRss/198260.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198260.html   
    2。如果POJO不存在关联关p,那么执行“mvn appfuse:gen -Dentity=Name”时Q如果Entity没有在hibernate.cfg.xml里,则会(x)自动增加。如果存在关联关p,在POJO里注释了(jin)@OneToMany或?@ManyToManyQ直接执行“mvn appfuse:gen -Dentity=Name”很Ҏ(gu)报一下错误:(x)
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Use of @OneToMany or @ManyToMany targeting an unmapped class: com.reda.app.model.CompanyType.
    companies[com.reda.app.model.Company]
    [INFO] ------------------------------------------------------------------------
    [INFO] Trace
    org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com
    .reda.app.model.CompanyType.companies[com.reda.app.model.Company]
            at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.
    java:979)
    ......
  
    因ؓ(f)“mvn appfuse:gen -Dentity=Name”一ơ只支持一个EntityQ这h行会(x)很篏啊)(j)Q会(x)找不到对应的兌者。这Ӟ我们需要手动的有兌关系的Entity都加入到hibernate.cfg.xml里,再执行就可以?jin)?BR>   
    3。执行“mvn jetty:run-war”时Q会(x)Ҏ(gu)POJO先删除数据库里的表再重徏Q如果不惛_数据q行操作可以修改pom.xmlQ将drop熟?zhn)修改为false。不q执行“mvn jetty:run-war”仍然会(x)执行操作Q出现大量的错误日志Q不q没有媄(jing)响?BR>
 1    <groupId>org.codehaus.mojo</groupId>
 2    <artifactId>hibernate3-maven-plugin</artifactId>
 3    <version>2.0-alpha-2</version>
 4    <configuration>
 5        <components>
 6            <component>
 7                <name>hbm2ddl</name>
 8                <implementation>annotationconfiguration</implementation>
 9                <!-- Use 'jpaconfiguration' if you're using JPA. -->
10                <!--<implementation>jpaconfiguration</implementation>-->
11            </component>
12        </components>
13        <componentProperties>
14            <drop>false</drop>
15            <jdk5>true</jdk5>
16            <propertyfile>target/classes/jdbc.properties</propertyfile>
17            <skip>${maven.test.skip}</skip>
18        </componentProperties>
19    </configuration>


    4。执行“mvn jetty:run-war”时Q会(x)清空数据表的数据q插入默认的数据Q默认的数据?PROJECT_HOME%\src\main\resources\default-data.xml配置Q这个很讨厌。修改pom.xml可以屏蔽q部分操作?BR

 <dbunit.operation.type>NONE</dbunit.operation.type>

    5。执行“mvn jetty:run-war”时Q会(x)执行试Q很XP喔。如果测试通不q服务就起不来。找?jin)很多配|似乎都跳不q这一步?BR>    appfuse:gen-model时生成的POJOQ自增列不会(x)生成@Column注释Q就Ҏ(gu)报以下的错误Q增加相应的@Column可以了(jin)Q?nbsp;

   Unknown column 'this_.typeId' in 'field list'
    另外生成的测试类也不是直接可以测试通过的,q要针对数据做一些修攏V如果POJO存在兌关系Q测试类的关联部分也需要进行手动设值的?


文章来源: http://heyday.blogcn.com/diary,14897952.shtml

不同樊响 2008-05-04 20:57 发表评论
]]>[导入][AppFuse] AppFuse使用手记Q-目录l构Q三Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198259.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198259.htmlhttp://www.aygfsteel.com/heyday/comments/198259.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198259.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198259.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198259.html
    AppFuse的目录结构大致如下:(x)

    %PROJECT_HOME%
        ?--src (1)
        ?nbsp;   ?--main
        ?nbsp;   ?nbsp;   ?--java  (3)
        ?nbsp;   ?nbsp;   ?--resources (4)
        ?nbsp;   ?nbsp;   ?--webapp    (5)
        ?nbsp;   ?--site
        ?nbsp;   ?--test   (6)
        ?nbsp;   ?nbsp;   ?--java
        ?nbsp;   ?nbsp;   ?--resources                         
        ?--target  (2)
        ?nbsp;   ?--appfuse   
        ?nbsp;   ?nbsp;   ?--generated-sources (7)
        ?nbsp;   ?--classes    (8)
        ?nbsp;   ?--reda-1.0-SNAPSHOT.war  (9)
        ?nbsp;   ?--reda-1.0-SNAPSHOT  (10)
        ?nbsp;   ?--surefire-reports   (11)
        ?nbsp;   ?--test-classes   (12)
        ?nbsp;   ?--war    (13)
        ?nbsp;   ?nbsp;   ?--work
        ?nbsp;   ?nbsp;   ?nbsp;   ?--appfuse-struts-2.0.1
        ?nbsp;   ?nbsp;   ?nbsp;   ?--appfuse-web-common-2.0.1
        ?nbsp;   ?--warpath    (14)
        ?nbsp;   ?--work   (15)
        ?nbsp;   ?nbsp;   ?--jsp
        ?nbsp;   ?nbsp;   ?--webapp


    (1) 源代码目录,我们要修改代码应该是在这个目录?BR>    (2) 目标目录Q这部分目录基本上是执行相关命o(h)生成的?BR>    (3) java源代码目录,包括POJO、Action{?BR>    (4) 资源目录Q包括配|文件等
    (5) web应用源代码目?BR>    (6) 试源代码目?BR>    (7) appfuse自动生成的代?BR>    (8) 源代码编译输出目?BR>    (9) 目的war
    (10) ?9)解压的目?BR>    (11) 自动试报表目录  
    (12) 自动试~译输出目录  
    (13) war包解压目?BR>    (14) war解压目录
    (15) jetty发布目录

    q行?FONT color=#000099>mvn jetty:run-war”的序是:(x)
   
    1?1)的代码编译输出到(8)Q等同于执行?FONT color=#000099>mvn warpath:add-classes”?BR>    2。生?13)的warQ只?1)的部分不包括web应用?BR>    3?4)的资源文件native2asciiQ同时发布到(8)Q等同于执行?FONT style="BACKGROUND-COLOR: #ffffff" color=#000099>mvn native2ascii:native2ascii”?BR>    5。将(4)配置文g发布?8)Q等同于执行?FONT color=#000099>mvn resources:resources”?BR>    6?6)的代码编译输出到(12)?BR>    7?6)的资源文件native2asciiQ同时发布到(12)?BR>    8。自动测试生成测试报告到(11)?BR>    9。生?15)?BR>    10。生?13)?BR>    11。将(15)打包生成(9)?BR>
    执行?FONT color=#000099>mvn jetty:run-war”的相关日志信息Q可以看出?FONT color=#000099>mvn jetty:run-war”先后调用了(jin)那些命o(h)?/P>

    [INFO] [warpath:add-classes {execution: default}]
    [INFO] [aspectj:compile {execution: default}]
    [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
    [INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
    [INFO] [resources:resources]
    [INFO] [compiler:compile]
    [INFO] [resources:testResources]
   
    [INFO] [warpath:add-classes {execution: default}]
    [INFO] [aspectj:compile {execution: default}]
    [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
    [INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
    [INFO] [resources:resources]
    [INFO] [hibernate3:hbm2ddl {execution: default}]
    [INFO] [dbunit:operation {execution: test}]
    [INFO] [war:war]
    [INFO] [jetty:run-war]

    q行?FONT color=#000099>mvn war:inplace”,可以?5)生成?但是(4)的资源文件和配置文g是不?x)同步?5)下面。要?4)的配|文件同步到(5)下,需要在q行“mvn war:inplace”前先执行?FONT color=#000099>mvn resources:resources”,同于?4)的资源文件同步到(5)下,需要在q行?FONT color=#000099>mvn war:inplace”前先执行?FONT color=#000099>mvn native2ascii:native2ascii”?nbsp;      
   
    我们一般在(5)下进行开发(如果?10)或?15)下开发,q行?FONT color=#000099>mvn jetty:run-war”会(x)代码冲掉)(j)Q运行?FONT color=#000099>mvn jetty:run”启动Web服务Q需要注意的是必d除src\main\webapp\WEB-INF\lib和src\main\webapp\WEB-INF\classes\struts.xmlQ否则会(x)报错。如果习(fn)惯用TomcatQ也可以Tomcat的配|指向src\main\webappQ当然src\main\webapp\WEB-INF\lib和src\main\webapp\WEB-INF\classes\struts.xml׃需要删除了(jin)?BR>   
    当然在运行?FONT color=#000099>mvn appfuse:gen-model”和?FONT color=#000099>mvn appfuse:gen -Dentity=Name”时Q生成的文g都会(x)安装?15)Q只要再执行?FONT color=#000099>mvn war:inplace”就可以?jin)?
文章来源: http://heyday.blogcn.com/diary,14999843.shtml

不同樊响 2008-05-04 20:57 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-数据库中文问题(四)(j) [原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198258.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198258.htmlhttp://www.aygfsteel.com/heyday/comments/198258.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198258.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198258.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198258.html[MYSQL] 三步解决MysSQL中文问题 ?BR>
    修改pom.xmlQ?BR>
    <jdbc.url><![CDATA[jdbc:mysql://localhost/reda?createDatabaseIfNotExist=true&amp;characterEncoding=gbk]]></jdbc.url>
 
   修改taglibs.jspQ?
    <%@ page language="java" errorPage="/error.jsp" pageEncoding="GBK" contentType="text/html;charset=GBK" %>
 
   修改web.xmlQ?BR>
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>GBK</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    l果Q查询显C正,但是更新和插入都出现q?BR>   
    反复折腾?jin)好久,更新和插入还是ؕ码,估计是AppFuse里哪部分代码做了(jin)字符转行Q现在对AppFuseq不是很熟?zhn)Q也不知道该从哪里下手?BR>   
    上网查了(jin)查,说UTF-8~码是一U兼Ҏ(gu)有语a的编码方式,所以UTF-8才是王道。又l回到UTF-8上来Q既然AppFuse默认是UTF-8Q那问题应该不是出在AppFuse上,应该是在MySQL上?BR>   
    把数据库全都切换到utf8上,数据库和表的DDL都加上字W集讄Q?BR>
    CHARACTER SET utf8 COLLATE utf8_general_ci

    修改MySQL的配|文件my.iniQ?BR>
    default-character-set=utf8

    可以通过下面的命令查看字W集Q?BR>
    mysql>  show variables like 'character_set_%';
    +--------------------------+-----------------------------------------------+
    | Variable_name            | Value                                         |
    +--------------------------+-----------------------------------------------+
    | character_set_client     | utf8                                          |
    | character_set_connection | utf8                                          |
    | character_set_database   | utf8                                          |
    | character_set_filesystem | binary                                        |
    | character_set_results    | utf8                                          |
    | character_set_server     | utf8                                          |
    | character_set_system     | utf8                                          |
    | character_sets_dir       | D:\Dev\MySQL\MySQL Server 5.0\share\charsets\ |
    +--------------------------+-----------------------------------------------+

    l过上面的修改,中文问题p决了(jin)QAppFuse的CRUD都正怺(jin)?BR>   
   
    如果使用MySQL Command Line ClientQ我们查看数据库看到是还是ؕ码,执行插入时还?x)报错?x)?Data too long for column 'type_name' at row 1”。可以在执行前,先执行:(x)set names gbkQ这样就可以?jin)?BR>
    mysql> set names utf8;
    Query OK, 0 rows affected (0.00 sec)
   
    mysql> select * from company_type;
    +---------+-----------+--------+
    | type_id | type_name | status |
    +---------+-----------+--------+
    |       1 | 娴嬭?nbsp;     |       |
    |       2 | 鍑洪?nbsp;     |       |
    +---------+-----------+--------+
    2 rows in set (0.00 sec)
   
    mysql> insert into company_type(type_name,status) values('出错',1);
    ERROR 1406 (22001): Data too long for column 'type_name' at row 1
    mysql> set names gbk;
    Query OK, 0 rows affected (0.00 sec)
   
    mysql> insert into company_type(type_name,status) values('出错',1);
    Query OK, 1 row affected (0.03 sec)
   
    mysql> select * from company_type;
    +---------+-----------+--------+
    | type_id | type_name | status |
    +---------+-----------+--------+
    |       1 | 试          |       |
    |       2 | 出错          |       |
    |       3 | 出错          |       |
    +---------+-----------+--------+
    3 rows in set (0.00 sec)



     附一QMysql中校寚wutf8_unicode_ci与utf8_general_ci的区?BR>

当前Qutf8_unicode_ci校对规则仅部分支持Unicode校对规则法。一些字W还是不能支持。ƈ且,不能完全支持l合的记受这主要影响南和俄|斯的一些少数民族语aQ如QUdmurt 、Tatar、Bashkir和Mari?/P>

    utf8_unicode_ci的最主要的特色是支持扩展Q即当把一个字母看作与其它字母l合相等时。例如,在d语和一些其它语a中‘ß’等于‘ss’?/P>

    utf8_general_ci是一个遗留的 校对规则Q不支持扩展。它仅能够在字符之间q行逐个比较。这意味着utf8_general_ci校对规则q行的比较速度很快Q但是与使用utf8_unicode_ci?校对规则相比Q比较正性较差)(j)?/P>

    例如Q用utf8_general_ci和utf8_unicode_ci两种 校对规则下面的比较相{:(x)
    Ä = A
    Ö = O
    Ü = U

    两种校对规则之间的区别是Q对于utf8_general_ci下面的等式成立:(x)
    ß = s

    但是Q对于utf8_unicode_ci下面{式成立Q?BR>    ß = ss

    对于一U语a仅当使用utf8_unicode_ci排序做的不好Ӟ才执行与具体语言相关的utf8字符?校对规则。例如,对于徯和法语,utf8_unicode_ci工作的很好,因此不再需要ؓ(f)q两U语a创徏Ҏ(gu)的utf8校对规则?/P>

    utf8_general_ci也适用与d语和法语Q除?jin)‘ß’等于‘s’,而不是‘ss’之外。如果你的应用能够接受这些,那么应该使用utf8_general_ciQ因为它速度快。否则,使用utf8_unicode_ciQ因为它比较准确?/P>


    附二Q?BR>    使用MySQL的命令终端时Q如果输入SQL有误Q将有beep声。若要关闭该功能Q根据mysql --helpQ用mysql --no-beep卛_?
    修改my.ini
    在[mysql] 下加入一?nbsp;Q?nbsp;
    no-beep   

文章来源: http://heyday.blogcn.com/diary,15090253.shtml

不同樊响 2008-05-04 20:57 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-资源文g中文问题Q五Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198257.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198257.htmlhttp://www.aygfsteel.com/heyday/comments/198257.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198257.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198257.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198257.html 
    在网上找?jin)找Q如果在%PROJECT_HOME%q行Q?BR>
    native2ascii -encoding UTF-8 .\src\main\resources\ApplicationResources_zh_CN.properties .\src\main\webapp\WEB-INF\classes\ApplicationResources_zh_CN.properties
    则显C正常?BR>
    AppFuse的pom.xml里明明制定了(jin)UTF-8Qؓ(f)什么文件就变成?jin)GB18030呢?
 1    <plugin>
 2        <groupId>org.codehaus.mojo</groupId>
 3        <artifactId>native2ascii-maven-plugin</artifactId>
 4        <version>1.0-alpha-1</version>
 5        <configuration>
 6            <dest>target/classes</dest>
 7            <src>src/main/resources</src>
 8        </configuration>
 9        <executions>
10            <execution>
11                <id>native2ascii-utf8</id>
12                <goals>
13                    <goal>native2ascii</goal>
14                </goals>
15                <configuration>
16                    <encoding>UTF8</encoding>
17                    <includes>
18                        ApplicationResources_ko.properties,
19                        ApplicationResources_no.properties,
20                        ApplicationResources_tr.properties,
21                        ApplicationResources_zh*.properties
22                    </includes>
23                </configuration>
24            </execution>
25            <execution>
26                <id>native2ascii-8859_1</id>
27                <goals>
28                    <goal>native2ascii</goal>
29                </goals>
30                <configuration>
31                    <encoding>8859_1</encoding>
32                    <includes>
33                        ApplicationResources_de.properties,
34                        ApplicationResources_fr.properties,
35                        ApplicationResources_nl.properties,
36                        ApplicationResources_pt*.properties
37                    </includes>
38                </configuration>
39            </execution>
40        </executions>
41    </plugin>

    查看JDK的native2ascii文Q?BR>
    -encoding encoding_name
    Specify the encoding name which is used by the conversion procedure. The default encoding is taken from System property file.encoding. The encoding_name string must be taken from the first column of the table of supported encodings in the Supported Encodings document.

    原来执行native2asciiӞ默认取系l的file.encoding做ؓ(f)~码格式。试着输出file.encodingQ果然是GB18030。难道是AppFuse执行“native2ascii:native2ascii”时Q没有制定编码?
   
    反编译repository\org\codehaus\mojo\native2ascii-maven-plugin\1.0-alpha-1\native2ascii-maven-plugin-1.0-alpha-1.jar!\org\codehaus\mojo\native2ascii\Native2AsciiMojo.class
 1    protected void executeAnt()
 2    {
 3        Project antProject = new Project();
 4        antProject.setName("native2ascii");
 5        Native2Ascii antTask = new Native2Ascii();
 6        antTask.setProject(antProject);
 7        antTask.setSrc(src);
 8        antTask.setDest(dest);
 9        antTask.setEncoding(encoding);
10        antTask.setExt(ext);
11        antTask.setExcludes(excludes);
12        antTask.setIncludes(includes);
13        antTask.execute();
14    }
    代码也很单,调用Ant的API实现转换。估计Ant也不?x)出C么问题,Z么会(x)使用pȝ默认的编码呢Q试着输出encodingQ发现encoding居然为nullQ会(x)不会(x)是从pom.xml里没有取到encoding的设|呢Q?BR>   
    修改pom.xmlQ尝试增加encoding节点
1    <groupId>org.codehaus.mojo</groupId>
2    <artifactId>native2ascii-maven-plugin</artifactId>
3    <version>1.0-alpha-1</version>
4    <configuration>
5        <dest>target/classes</dest>
6        <src>src/main/resources</src>
7        <encoding>UTF-8</encoding>
8    </configuration>
    再运行“mvn native2ascii:native2ascii”,发现encoding有g(jin)Q但是生成的文g~码q是GB18030Q不q运行服务,中文q没有?jin)。看来和文g~码没有太大关系Q应该是native2ascii转换旉用默认的GB18030~码转换D的?BR>   
    另外pom.xml只配|了(jin)ApplicationResources_zh*.properties的字W{换,AppFuseq有displaytag_zh.properties也需要{换,我们可以把pom.xml里ApplicationResources_zh*.properties都换?_zh*.properties可以了(jin)?BR>
 1    <configuration>
 2        <encoding>UTF8</encoding>
 3        <includes>
 4            ApplicationResources_ko.properties,
 5            ApplicationResources_no.properties,
 6            ApplicationResources_tr.properties,
 7            *_zh*.properties
 8        </includes>
 9    </configuration>
10
11    
12    
13    <resource>
14        <directory>src/main/resources</directory>
15        <excludes>
16            <exclude>ApplicationResources_de.properties</exclude>
17            <exclude>ApplicationResources_fr.properties</exclude>
18            <exclude>ApplicationResources_ko.properties</exclude>
19            <exclude>ApplicationResources_nl.properties</exclude>
20            <exclude>ApplicationResources_no.properties</exclude>
21            <exclude>ApplicationResources_pt*.properties</exclude>
22            <exclude>ApplicationResources_tr.properties</exclude>
23            <exclude>*_zh*.properties</exclude>
24            <exclude>applicationContext-resources.xml</exclude>
25            <exclude>struts.xml</exclude>
26        </excludes>
27        <filtering>true</filtering>
28    </resource>

文章来源: http://heyday.blogcn.com/diary,15137426.shtml

不同樊响 2008-05-04 20:57 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-一对多Q六Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198256.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198256.htmlhttp://www.aygfsteel.com/heyday/comments/198256.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198256.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198256.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198256.html
    1。先参?[AppFuse] AppFuse使用手记Q-试例Q二Q?[原] 生成POJO和其它源文g?BR>
    2。修改web.xmlQ打开lazyLoadingFilter配置QAppFuse原本是支持的Q只是默认注释调?jin),如果没有打开Q会(x)报如下错误:(x)
    org.hibernate.LazyInitializationException: could not initialize proxy - no Session
     at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
     at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
     at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)

    3。界面显C显C列表时Q一对多的列默认是不昄的,我们需要手工增加display部分?BR>
1<display:column property="companyType.typeName" sortable="true" titleKey="companyType.typeName"/>
 
    4。新增和修改Ӟ面?x)出现错误,昄不出来,看看JSP面QAppFuse也要求我们手工修改:(x)
1<!-- todo: change this to read the identifier field from the other pojo -->
2<s:select name="company.companyType.typeId" list="companyTypeList" listKey="typeId" listValue="typeName" ></s:select>

    错误原因主要是因为需要companyTypeList不存在,我们可在Action里实现getCompanyTypeListҎ(gu)?BR>
 1    public class CompanyAction extends BaseAction implements Preparable {
 2        private GenericManager<Company, Long> companyManager;
 3        private GenericManager<CompanyType, Long> companyTypeManager;
 4        private List companies;
 5        private Company company;
 6        private Long companyId;
 7        
 8        public void setCompanyManager(GenericManager<Company, Long> companyManager) {
 9            this.companyManager = companyManager;
10        }

11        
12        public void setCompanyTypeManager(GenericManager<CompanyType, Long> companyTypeManager) {
13            this.companyTypeManager = companyTypeManager;
14        }
    
15        
16        public List getCompanies() {
17            return companies;
18        }

19        
20        public List getCompanyTypeList() {
21            return companyTypeManager.getAll();
22        }

23        
24              
25    }
    q样面可以显C对应的下拉列表?jin)?BR>
    5。CRUD中,当Update一对多一列时Q会(x)出现错误Q?BR>
    identifier of an instance of com.reda.app.model.CompanyType was altered from 11 to 1; nested exception is org.hibernate.HibernateException: identifier of an instance of com.reda.app.model.CompanyType was altered from 11 to 1
   
    在网上找?jin)找Q错误的原因主要是因为Action在开始时Q会(x)持久化对象,在组装数据时Q会(x)用新数据替换旧数据,如果被替换的是持久化对象Q在替换子对象关pLQ会(x)(g)查到子对象的Id被强制修改的错误Q而持久化对象的Id值是不能被更改的?
   
    debugӞ发现在UpdateӞ?x)调用prepare先持久化Q注释调q部分,可以了(jin)?BR>
 1    /**
 2     * Grab the entity from the database before populating with request parameters
 3     */
    
 4    public void prepare() {
 5        if (getRequest().getMethod().equalsIgnoreCase("post")) {
 6            // prevent failures on new
 7            String companyId = getRequest().getParameter("company.companyId");
 8//            if (companyId != null && !companyId.equals("")) {
 9//                company = companyManager.get(new Long(companyId));
10//            }
11        }

12    }

文章来源: http://heyday.blogcn.com/diary,15301923.shtml

不同樊响 2008-05-04 20:57 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-DAOQ七Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198255.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198255.htmlhttp://www.aygfsteel.com/heyday/comments/198255.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198255.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198255.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198255.html阅读全文

不同樊响 2008-05-04 20:57 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-ValidatorQ八Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198254.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198254.htmlhttp://www.aygfsteel.com/heyday/comments/198254.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198254.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198254.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198254.html   
    而Validator的配|文件ؓ(f)ActionName-validation.xmlQ即每个xml对应于一个Action。所以需要我们把不同的操作放C同的Action里,在配|不同的xml验规则。这h一个问题,是可能引vAction的类爆炸Q而且不同的Action里可能会(x)有很多相同的代码。我但是惌不能用Action的extends来避免这个问题。后来发现Action的extends是可以规避类爆炸的问题,可是效验q是?x)出现向前的问题Q原因是因ؓ(f)“WebWork搜烦(ch)zdcȝl承?wi)寻扄cL接口的校验规则”。就是说Q验框架按照自上而下的顺序在cdơ查N|文件?BR>   
    q有一U解决的Ҏ(gu)Q就是自己写一个ValidatorQ可以参考结?A class=diary_url target=_blank>验证在struts中减Action和ActionForm的数?/A>?BR>   
    我徏议WebWork可以考虑在Validator的效验规则里象struts.xml的Action标签一样增加method参数。可以根据不同的method定义不同的效验规则?
文章来源: http://heyday.blogcn.com/diary,15423464.shtml

不同樊响 2008-05-04 20:57 发表评论
]]>
[导入][AppFuse] AppFuse使用手记Q-Display Tag 分页Q九(ji)Q?[原]http://www.aygfsteel.com/heyday/archive/2008/05/04/198253.html不同樊响不同樊响Sun, 04 May 2008 12:57:00 GMThttp://www.aygfsteel.com/heyday/archive/2008/05/04/198253.htmlhttp://www.aygfsteel.com/heyday/comments/198253.htmlhttp://www.aygfsteel.com/heyday/archive/2008/05/04/198253.html#Feedback0http://www.aygfsteel.com/heyday/comments/commentRss/198253.htmlhttp://www.aygfsteel.com/heyday/services/trackbacks/198253.html阅读全文

不同樊响 2008-05-04 20:57 发表评论
]]>
վ֩ģ壺 ǹ| | ͨ| ĺ| | | | ĺ| | ũ| | | ʲ| | | | ɼ| Ϫ| | Ϫ| ˮ| ƽ| | | | ȫ| | | | | ɽ| ϰ| ¬| | ұ| | | Ҿ| Ĭ| | |