错误原因是lz的 <action path="/login" type="org.springframework.web.struts.DelegatingActionProxy" name="loginForm"
input="/login.jsp"
scope="request" validate="true" >
<forward name="success" path="/main.jsp" />
</action> 中的path="/login"与 <bean name="/loginForm" class = "com.tools.action.LoginAction">
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean> 中的name没有对应解决办法:
改成一致就好了把applicationContext.xml
<bean name="/loginForm" class = "com.tools.action.LoginAction">
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean> 改成 <bean name="/login" class = "com.tools.action.LoginAction">
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean>
input="/login.jsp"
scope="request" validate="true" >
<forward name="success" path="/main.jsp" />
</action> 中的path="/login"与 <bean name="/loginForm" class = "com.tools.action.LoginAction">
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean> 中的name没有对应解决办法:
改成一致就好了把applicationContext.xml
<bean name="/loginForm" class = "com.tools.action.LoginAction">
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean> 改成 <bean name="/login" class = "com.tools.action.LoginAction">
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean>
解决方案 »
- Div+Css的用法
- 关于Struts2页面数据传递到Action的问题
- 现在的JavaEE开发都还分很多层吗?
- IO Connection reset !java.sql.SQLException: Already closed,可能是DBCP的问题。。
- Struts+Spring+Hibernate Web工程的初始化过程?
- SSH开发上配置mappingResources的时候为什么以下两种方式第二种不好用呢,谢谢
- 这里可以下载《JSF第一步》增删改数据库表中记录的简明示例
- FileWriter写入文本换行?
- ------[J2EE工具---IDE---精华谈]------3层构架的开发工具------优劣--性能--易用性----
- struts in action 中 register-complete的问题,希望各位帮助,在线等
- 请问学习了Java EE 5的基础教程后怎样拓展、深入研究?
- tomcat 6.0 启动问题
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean> 有没有AUTHIMPL这个属性.有没有SET和GET方法?
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean id="authImpl" class="com.tools.auth.AuthImpl" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="jdbcTemplate">
<ref bean="jdbcTemplate"/>
</property>
</bean>
<bean name="/login" class = "com.tools.action.LoginAction">
<property name="authImpl">
<ref bean="authImpl"/>
</property>
</bean>
这个是authImpl的xml设置, 我不知道是否正确
解决如下: 修改了bean id "authImpl" 指向接口AuthService