标题:HTTP Status 404 - Servlet action is not available错误提示!
取消只看楼主
ablikim
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:47
专家分:104
注 册:2010-8-11
结帖率:100%
 问题点数:0 回复次数:2 
HTTP Status 404 - Servlet action is not available错误提示!
         今天遇到了这个错误提示的问题,下面将部分代码贴出来,请高手们指点,感激不尽!
1.struts-config.xml的配置文件。
<struts-config>
    <data-sources />
    <form-beans>
        <form-bean name="loginForm"
            type="com.sailing.struts.form.LoginForm" />

    </form-beans>

    <global-exceptions />
    <global-forwards />
    <action-mappings>
        <action
      attribute="loginForm"
      input="/login.jsp"
      name="loginForm"
      path="/login"
      scope="request"
      type="org.springframework.web.struts.DelegatingActionProxy">
      <forward name="error" path="/error.jsp" />
      <forward name="success" path="/index.jsp" />
    </action>

    </action-mappings>

    <message-resources
        parameter="com.sailing.struts.ApplicationResources" />
    <plug-in
        className="org.springframework.web.struts.ContextLoaderPlugIn">
        <set-property property="contextConfigLocation"
            value="/WEB-INF/classes/applicationContext.xml" />
    </plug-in>
</struts-config>
 
 
2.applicationContext.xm文件
    <bean id="dataSource"
        class="org.
        <property name="driverClassName"
            value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
        </property>
        <property name="url"
            value="jdbc:sqlserver://127.0.0.1:1433;databaseName=School">
        </property>
        <property name="username" value="sa"></property>
        <property name="password" value="123456"></property>
    </bean>
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource"></ref>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.SQLServerDialect
                </prop>
            </props>
        </property>
        <property name="mappingResources">
            <list>
                <value>com/sailing/entity/Student.hbm.xml</value>
            </list>
        </property>
    </bean>
    <bean id="template"
        class="org.springframework.orm.hibernate3.HibernateTemplate">
        <property name="sessionFactory" value="sessionFactory"></property>
    </bean>

    <bean id="studentDao" class="com.sailing.dao.StudentDao">
        <property name="template" value="template"></property>
    </bean>

    <bean id="studentService"
        class="com.sailing.service.StudentService">
        <property name="studentDao" value="studentDao"></property>
    </bean>

    <bean name="/login" class="com.sailing.struts.action.LoginAction">
        <property name="studentService" value="studentService"></property>
    </bean>
</beans>

3.web.xml文件的配置,
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>3</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
  </welcome-file-list>
</web-app>

4.login.jsp页面代码
<html>
    <head>
        <title>JSP for LoginForm form</title>
    </head>
    <body>
        <html:form action="/login.do">
            userName : <html:text property="userName" />
            <html:errors property="userName" />
            <br />
            password : <html:text property="password" />
            <html:errors property="password" />
            <br />
            <html:submit />
            <html:cancel />
        </html:form>
    </body>
</html>





检查了配置文件应该没有错误,这里将全部贴出来了,网上找了很多类似的问题,但都没能解决问题,恳请各位指点指点。
 
 
搜索更多相关主题的帖子: Status action HTTP Servlet available 
2010-10-08 13:40
ablikim
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:47
专家分:104
注 册:2010-8-11
得分:0 
没有人回答嘛?还是觉得代码太长,就没往下看,我查看了网上许多人都遇到类似的问题,求其解决方法啊,谢谢!

妈妈问我:有女朋友嘛?  我:没有!  妈妈:这个可以有! 我:这个真没有!!
2010-10-11 11:30
ablikim
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:47
专家分:104
注 册:2010-8-11
得分:0 
好了问题解决了,是包的问题,重新导包就解决问题了

妈妈问我:有女朋友嘛?  我:没有!  妈妈:这个可以有! 我:这个真没有!!
2010-10-12 12:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-322241-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.161691 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved