各位大虾,我是SSH初学者。版本 struts2.0+spring2.0+hibernate3.0
我想请教下各位:
我的数据库连接是单独些在 hibernate.config.xml中的,然后我配置spring的配置文件,为了方便管理,所以我想配置多个spring的的配置文件,请问该怎么写xml文件,谢谢,急
我想请教下各位:
我的数据库连接是单独些在 hibernate.config.xml中的,然后我配置spring的配置文件,为了方便管理,所以我想配置多个spring的的配置文件,请问该怎么写xml文件,谢谢,急
解决方案 »
- struts验证怪问题
- 关于span标签
- JSF中DataTable处理多选的问题
- jstl when otherwise 多重判断问题
- Java开发的门户,在一个portlet首页上,如何实现刷新整个页面,而其中的一部分内容不刷新!
- 关于数据库连接
- 有人熟悉xmlhtml局部刷新和cordys平台技术吗?请介绍或给出资料。 高分相送!!
- 对于session过期问题,大家有什么好的解决办法
- 查询数据显示不完全?
- JSplitPane如何动态调整左右帧的大小?如何监听窗口变大,缩小的事件?(java中好像没有)
- struts2 这样用标签格式化人名币 如:¥1,000,000.00 在线等!
- 迷惑中...关于freemarker
然后你想多加几个配置文件的话,就在这个applicationContext.xml里加入:
<import resource="文件名"/>
就可以了
如:
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<import resource="context-config/context-framework.xml"/>
<import resource="context-config/context-user.xml"/>
</beans>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml</param-value>
</context-param>在WEB-INF下的applicationContext-*.xml都写成;例如applicationContext-bean.xml
我定义一个public Interface User 然后 public UserDao implement User;我在ACTION中只能采用
User user=new UserDao();然后才可以用user去调用的DAO层的方法,我想要的是通过配置文件 在ACTION中直接 get set 后,直接就可以 定义 private User user;然后直接就能用user调用配置后的DAO层,而不需要 User user=new UserDao();