当前位置: 代码迷 >> Java Web开发 >> ssh spring不知道问啥无法注入,该怎么处理
  详细解决方案

ssh spring不知道问啥无法注入,该怎么处理

热度:403   发布时间:2016-04-17 00:41:15.0
ssh spring不知道问啥无法注入
XML code
<bean id="sql" class="org.apache.commons.dbcp.BasicDataSource">        <property name="driverClassName"            value="com.microsoft.sqlserver.jdbc.SQLServerDriver">        </property>        <property name="url"            value="jdbc:sqlserver://localhost:1433;databaseName=hr_db">        </property>        <property name="username" value="sa"></property>        <property name="password" value="sa"></property>    </bean>    <bean id="sessionFactory"        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">        <property name="dataSource">            <ref bean="sql" />        </property>        <property name="hibernateProperties">            <props>                <prop key="hibernate.dialect">                    org.hibernate.dialect.SQLServerDialect                </prop>                <prop key="hibernate.show_sql">true</prop>            </props>        </property>        <property name="mappingResources">            <list>                <value>com/ssh/entity/Users.hbm.xml</value></list>        </property></bean>                <!-- dao -->        <bean id="baseDao" class="com.ssh.dao.BaseDao">            <property name="sessionFactory" ref="sessionFactory"></property>        </bean>        <bean id="userDao" class="com.ssh.dao.UsersDao" parent="baseDao">            <property name="baseDao" ref="baseDao"></property>        </bean>                                <!-- biz -->        <bean id="userBiz" class="com.ssh.biz.UsersBiz">            <property name="userDao" ref="userDao"></property>        </bean>                <!-- action -->        <bean name="/users" class="com.ssh.web.action.UsersAction">            <property name="userBiz" ref="userBiz"></property>        </bean>        </beans>


XML code
<struts-config>  <data-sources />  <form-beans >    <form-bean name="usersForm" type="com.ssh.web.form.UsersForm" />  </form-beans>  <global-exceptions />  <global-forwards />  <action-mappings >    <action      attribute="usersForm"      input="/login.jsp"      parameter="o"      name="usersForm"      path="/users"      scope="request"      type="com.ssh.web.action.UsersAction" />  </action-mappings>  <message-resources parameter="com.ssh.web.ApplicationResources" />   <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">        <set-property             property="contextConfigLocation"            value="classpath:applicationContext.xml" />  </plug-in>  </struts-config>


java.lang.NullPointerException
at com.ssh.web.action.UsersAction.execute(UsersAction.java:49)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Sat Dec 15 12:50:50 CST 2018
  • 最近登录:Sat Dec 15 12:50:50 CST 2018
  • 最近登录:Sat Dec 15 12:50:50 CST 2018
  • 最近登录:Sat Dec 15 12:50:50 CST 2018
  • 最近登录:Sat Dec 15 12:50:50 CST 2018