SSH学习中遇见的问题

在学学习SSH过程中常遇见下面两个错误异常

1.Servlet action is not available

     出现这个异常一般是配置文件的错误

     可以参考http://blog.csdn.net/yangshoubo/archive/2009/09/05/4523457.aspx

2.java.lang.NullPointerException    ×××.action.×××Action.xxxx

          意思是说不能够执行某个Action,因为整合后的Hibernate是交给Spring来处理的,首先要看看applicationContext.xml文件中该Action的path是否和struts-config.xml中的一致,类型是否是Spring中所定义的类型,因为还很有可能是类型不一致造成的。

解决方法:
(1).struts-config.xml的action的type必须是org.springframework.web.struts.DelegatingActionProxy
(2).删除action的type属性,就不需要这个属性。
(3).在struts-config.xml中添加一个controller
<controller>
    <set-property property="processorClass"
  value="org.springframework.web.struts.DelegatingRequestProcessor" />
</controller>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值