我的代码如下
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost/air"></property>
<property name="username" value="root"></property>
<property name="password" value="19881023"></property>
<property name="maxActive" value="100"></property>
<property name="maxIdle" value="30"></property>
<property name="maxWait" value="500"></property>
<property name="defaultAutoCommit" value="true"></property>
</bean> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/air/bean/Userinfo.hbm.xml</value>
<value>com/air/bean/Flight.hbm.xml</value>
<value>com/air/bean/Managerinfo.hbm.xml</value>
</list>
</property>
</bean> <bean id="userinfoDao" class="com.air.dao.UserinfoDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean> <bean id="userService" class="com.air.service.UserService"
scope="prototype">
<property name="userinfoDao">
<ref bean="userinfoDao" />
</property>
</bean>
<bean id="RegisterAction" class="com.air.action.RegisterAction">
<property name="userService" ref="userService"></property>
</bean>
<bean id="LoginAction" class="com.air.action.LoginAction">
<property name="userService" ref="userService"></property>
</bean>
<bean id="flightDao" class="com.air.dao.FlightDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="flightService" class="com.air.service.FlightService" scope="prototype">
<property name="flightDao" ref="flightDao"/>
</bean>
<bean id="SearchAction" class="com.air.action.SearchAction">
<property name="flightService" ref="flightService"></property>
</bean>
<bean id="ManagerinfoDAO" class="com.air.dao.ManagerinfoDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ManagerService" class="com.air.service.ManagerService" scope="prototype">
<property name="ManagerinfoDAO" ref="ManagerinfoDAO"/>
</bean>
<bean id="ManagerLoginAction" class="com.air.action.ManagerLoginAction">
<property name="ManagerService" ref ="ManagerService"></property>
</bean>
//关键就是错在 managerservice 和managerloginaction两端 编译器说invalid property name‘ManagerinfoDAO’‘ManagerService’not javabean compliant
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost/air"></property>
<property name="username" value="root"></property>
<property name="password" value="19881023"></property>
<property name="maxActive" value="100"></property>
<property name="maxIdle" value="30"></property>
<property name="maxWait" value="500"></property>
<property name="defaultAutoCommit" value="true"></property>
</bean> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/air/bean/Userinfo.hbm.xml</value>
<value>com/air/bean/Flight.hbm.xml</value>
<value>com/air/bean/Managerinfo.hbm.xml</value>
</list>
</property>
</bean> <bean id="userinfoDao" class="com.air.dao.UserinfoDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean> <bean id="userService" class="com.air.service.UserService"
scope="prototype">
<property name="userinfoDao">
<ref bean="userinfoDao" />
</property>
</bean>
<bean id="RegisterAction" class="com.air.action.RegisterAction">
<property name="userService" ref="userService"></property>
</bean>
<bean id="LoginAction" class="com.air.action.LoginAction">
<property name="userService" ref="userService"></property>
</bean>
<bean id="flightDao" class="com.air.dao.FlightDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="flightService" class="com.air.service.FlightService" scope="prototype">
<property name="flightDao" ref="flightDao"/>
</bean>
<bean id="SearchAction" class="com.air.action.SearchAction">
<property name="flightService" ref="flightService"></property>
</bean>
<bean id="ManagerinfoDAO" class="com.air.dao.ManagerinfoDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ManagerService" class="com.air.service.ManagerService" scope="prototype">
<property name="ManagerinfoDAO" ref="ManagerinfoDAO"/>
</bean>
<bean id="ManagerLoginAction" class="com.air.action.ManagerLoginAction">
<property name="ManagerService" ref ="ManagerService"></property>
</bean>
//关键就是错在 managerservice 和managerloginaction两端 编译器说invalid property name‘ManagerinfoDAO’‘ManagerService’not javabean compliant
</beans>
解决方案 »
- 关于AJAX和JS
- 这样的json返回格式在struts2中如何做
- 类中的 一个公共方法,加上static修饰和不加对性能有什么影响没有?
- 在某个项目中遇到问题,el表达式只能在标签内使用?
- jsp2.0 function标签 和iframe自适应高度的问题
- jsp调试出错 请大虾指点!
- jstl, c:import的问题
- 请问为什么我在JSP上无法使用UPdate写入数据喃,运行后也没有报错,打出来的语句也可以在数据库上运行.郁闷啊!
- 应届毕业生!大家帮帮忙找个工作!
- JAVA: org.apache.jasper.JasperException: java.lang.NullPointerException
- 关于数据库连接的问题
- 调用WebService报异常
再进行get set 看看