第一范文网 - 专业文章范例文档资料分享平台

Struts2+spring2+hibernate3整合方案

来源:用户分享 时间:2025/5/18 6:20:05 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

userService

transactionInterceptor

applicationContext-dao.xml内容:

applicationContext-service.xml内容:

action-servlet.xml内容:

以上几个xml文件的内容暂且不要理会,继续往下看,你就自动明白的,不用我解释。 4)日志部分:log4j.properties 、commons-logging.properties log4j.properties内容:

# For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!

# For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.

log4j.rootLogger=INFO, stdout, logfile

log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

log4j.appender.logfile=org.apache.log4j.RollingFileAppender

log4j.appender.logfile.File=${firstssh.root}/WEB-INF/logs/firstssh.log log4j.appender.logfile.MaxFileSize=512KB # Keep three backup files.

log4j.appender.logfile.MaxBackupIndex=3

# Pattern to output: date priority [category] - message log4j.appender.logfile.layout=org.apache.log4j.PatternLayout

log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n # OpenSymphony Stuff

log4j.logger.com.opensymphony=INFO log4j.logger.org.apache.struts2=INFO # Spring Stuff

log4j.logger.org.springframework=INFO # Hibernate Stuff

log4j.logger.org.hiberante=INFO

commons-logging.properties 内容:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

5)web.xml

xsi:schemaLocation=\ml/ns/j2ee/web-app_2_4.xsd\ version=\

firstssh

this is a simple example

webAppRootKey firstssh.root

contextConfigLocation

/WEB-INF/applicationContext-*.xml,/WEB-INF/action-servlet.xml

log4jConfigLocation /WEB-INF/log4j.properties

org.springframework.web.util.Log4jConfigListener

org.springframework.web.context.ContextLoaderListener

Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top