SpringSide中文论坛


 
标题: SpringSide自建项目对配置文件的修改
1986jade
SpringSide社员
Rank: 1



UID 18451
精华 0
积分 1
帖子 1
阅读权限 10
注册 2009-10-9
状态 离线
发表于 2009-10-10 14:22  资料 短消息 
SpringSide自建项目对配置文件的修改

一、所要修改的配置文件有:
       1、web.xml;  项目配置文件
       2、applicationContext.xml;spring配置文件
       3、applicationContext-security.xml;//SpringSecurity安全配置
       4、ehcache-hibernate-local.xml;//hibernate缓存配置文件
       5、application.properties  //数据库配置文件(在此处修改你要连接的数据库)
二、修改如下:
1、web.xml的修改: <display-name>examplehou</display-name>在此处改成你的项目名
2、applicationContext.xml的修改:<context:component-scan base-package="com.ucap" />把base-package的值改成你的包名;<property name="packagesToScan" value="你的包名.entity.*" />
3、applicationContext-security.xml的修改:<bean id="userDetailsService" class="你的包名.service.security.UserDetailsServiceImpl" />;<bean id="resourceDetailsService" class="我的包名.service.security.ResourceDetailsServiceImpl" />
4、ehcache-hibernate-local.xml的修改:
<cache name="你的包名.entity.security.User" maxElementsInMemory="500" eternal="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
properties="replicateAsynchronously=true,replicatePuts=false,replicateUpdates=true,replicateUpdatesViaCopy=false,replicateRemovals=true" />
</cache>
<cache name="你的包名.entity.security.User.roles" maxElementsInMemory="500" eternal="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
properties="replicateAsynchronously=true,replicatePuts=false,replicateUpdates=true,replicateUpdatesViaCopy=false,replicateRemovals=true" />
</cache>
<cache name="你的包名.entity.security.Role" maxElementsInMemory="500" eternal="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
properties="replicateAsynchronously=true,replicatePuts=false,replicateUpdates=true,replicateUpdatesViaCopy=false,replicateRemovals=true" />
</cache>
<cache name="你的包名.entity.security.Role.auths" maxElementsInMemory="500" eternal="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
properties="replicateAsynchronously=true,replicatePuts=false,replicateUpdates=true,replicateUpdatesViaCopy=false,replicateRemovals=true" />
</cache>
5、application.properties 的修改,我连的是mysql,信息如下:
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/xkland?useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=root
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

hibernate.show_sql=false
hibernate.format_sql=false
hibernate.ehcache_config_file=/ehcache/ehcache-hibernate-local.xml
到此相关的配置文件修改完成,现在就可以使用自己建的项目开始开发工作了
修改所有的类路径~
如果项目是从mini-web导入的,
还要修改开发环境下的.project文件

<name>mini-web</name>

还要修改发布路径

发布
顶部
[广告]
jitabc
SpringSide社员
Rank: 1



UID 12296
精华 0
积分 53
帖子 53
阅读权限 10
注册 2008-10-14
状态 离线
发表于 2009-10-25 16:10  资料 短消息 
直接用new-project.bat来NEW一个项目不就OK了
顶部
 


© 2005-2006 SpringSide.org.cn, Host on RedSaga.com, Powered by Discuz 5.0   Get SpringSide at SourceForge.net. Fast, secure and Free Open Source software downloads

粤ICP备08025786号