首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

struts2 + spring 整合有关问题

2012-12-26 
struts2 + spring 整合问题applicationContext.xml----------------------------------------------------

struts2 + spring 整合问题
applicationContext.xml

---------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

<beans >

<bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="locations">

<list><value>classpath:jdbc.properties</value></list>

</property>

</bean>

<bean name="logonAction" class="struts.action.logon.LogonAction" scope="prototype">

<property name="service" ref="logonService"/>

</bean>

<bean id="logonService" class="struts.service.logon.LogonService"></bean>

</beans>

---------------------------------------------------------

谁能帮我把这段加上注释 每段都是干什么的?我是在网上照扒的 不是很理解



还有我启动tomcat的时候 除了下面的错误

class path resource [jdbc.properties] cannot be opened because it does not exist


[最优解释]
LZ,自己看下src目录下面是否有jdbc.properties这个文件。

[其他解释]
没有啊。。。
那个文件应该从哪弄?
[其他解释]
没有的话,就自己弄一下吧。。
你的先弄清楚你程序里面怎么来调用这个文件的内容的,大体就是
jdbc:driverManger:值
jdbc:userName:值。。。
就是你数据库的4个属性,呵呵!
[其他解释]
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/test/ssh1
jdbc.username=postgres
jdbc.password=Fang1982!

热点排行