spring连数据库的配置文件(applicationContext.xml)好像找不到applicationContext?
这个是applicationContext.xml里面的代码
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="employeeDao" class="com.dao.impl.EmployeeImpl">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="employeebizimpl" class="com.biz.impl.EmployeeBizImpl">
<property name="employee" ref="employeeDao"></property>
</bean>
<bean id="loginAction" class="com.action.loginAction">
<property name="employeebiz" ref="employeebizimpl"></property>
</bean>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver">
</property>
<property name="url"
value="jdbc:oracle:thin:@127.0.0.1:1521:S2JSP">
</property>
<property name="username" value="system"></property>
<property name="password" value="sa"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/entity/BizClaimVoucherDetail.hbm.xml</value>
<value>com/entity/SysDepartment.hbm.xml</value>
<value>com/entity/BizAccount.hbm.xml</value>
<value>com/entity/SysDictionary.hbm.xml</value>
<value>com/entity/BizClaimVoucher.hbm.xml</value>
<value>com/entity/BizCheckResult.hbm.xml</value>
<value>com/entity/SysPosition.hbm.xml</value>
<value>com/entity/SysEmployee.hbm.xml</value></list>
</property></bean></beans>
------------------------------------------------------------------------------------------------------------
这个是web配置文件
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
-------------------------------------------------------------------------------------------
这是登陆的biz
private Employee employee;
public void setEmployee(Employee employee) {
this.employee = employee;
}
/**
* 用户登录
*/
public boolean login(SysEmployee see) {
// TODO Auto-generated method stub
return employee.login(see);
}
-------------------------------------------------------------------------------------------
这是action
private EmployeeBiz employeebiz;
public void setEmployeebiz(EmployeeBiz employeebiz) {
this.employeebiz = employeebiz;
}
public String execute(){
return null;
}
public String login(){
boolean boo = employeebiz.login(null);
if(boo){
return SUCCESS;
}
return INPUT;
}
-----------------------------------------------------------
可以进到action
但是employeebiz.login(null);进入不到login方法;