日期:2014-05-18  浏览次数:20626 次

hibernate+struts+spring后出现如下问题!请高手出马相助!!!


本人花了一天时间,做了个SSH登录示例!提交表单时出现HTTP Status 404 - Servlet action is not available错误!

struts-config.xml内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">

<struts-config>
  <data-sources />
  <form-beans >
<form-bean name="loginForm" type="form.LoginForm">
  <form-property name="userName" type="java.lang.String" />
  <form-property name="password" type="java.lang.String" />
</form-bean>
  </form-beans>
  <global-exceptions />
  <global-forwards />
  <action-mappings >
  <action
  name="loginForm"
  path="/login"
  scope="request"
  type="action.LoginAction"
  validate="false">
  <forward name="success" path="/success.jsp"/>
  </action>
  </action-mappings>
  <message-resources parameter="propertice.ApplicationResources" />
  <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
  <set-property property="contextConfigLocation" value="/WEB-INF/beans.xml"/>
  </plug-in>
</struts-config>

------解决方案--------------------
我刚刚遇到过这个问题,用了两天的时间解决了。在网上搜所这个问题,原因很多,没有定论。
我的问题是因为导入的包有问题
给你个提示,设置好log4j,这样后台可能有出错的提示,就好办了