当前位置:编程学习 > JAVA >>

新手求助!SSH框架开发的网上书店系统 运行Tomcat不报错 用浏览器进入login.jsp页面时出404错误

struts.xml配置文如下:
<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.custom.i18n.resources" value="globalMessages"/>
<constant name="struts.i18n.encoding" value="GBK"/>
<package name="Action" extends="struts-default">
<interceptors>
<interceptor name="authority" class="Interceptor.Authority"/>
<interceptor-stack name="mydefault">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="authority"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="mydefault"/>

<global-results>
            <result name="login">/login.jsp</result>
</global-results>

        <action name="validateName" class="Action.ValidateNameAction">
           <result name="json"/>
        </action>
 
<action name="Infor" class="Action.Infor">
<result name="success">/infor.jsp</result>
<result name="error">/infor.jsp</result>
<result name="input">/infor.jsp</result>
        </action>
<action name="DoOrder" class="Action.DoOrder">
<result name="success" type="redirect-action">/ListBooks</result>
<result name="error" type="redirect-action">/PreviewOrder</result>

        </action>
<action name="AddComment" class="Action.AddComment">
<result name="success" type="redirect-action">ListBooks</result>
<result name="error" type="redirect-action">ListBooks</result>

        </action>
    <action name="FavBook" class="Action.FavBook">
<result name="success">/favBook.jsp</result>
        </action>
    <action name="DeleteFav" class="Action.DeleteFav">
<result name="success" type="redirect-action">FavBook</result>
            <result name="error" type="redirect-action">FavBook</result>
        </action>
    <action name="AddFav" class="Action.AddFav">
<result name="success" type="redirect-action">ListBooks</result>

        </action>
    <action name="PreviewOrder" class="Action.PreviewOrder">
<result name="success">/previewOrder.jsp</result>

        </action>
    <action name="Password" class="Action.Password">
<result name="success">/password.jsp</result>
<result name="error">/password.jsp</result>
<result name="input">/password.jsp</result>
        </action>
    <action name="ListOrder" class="Action.ListOrder">

<result name="success">/listOrders.jsp</result>
        </action>
</package>


<package name="NoInterceptorAction" extends="struts-default">
    <action name="Register" class="Action.Register">
           <result name="success">/regOK.jsp</result>
<result name="error">/reg.jsp</result>
   <result name="input">/reg.jsp</result>
        </action>
<action name="Login" class="Action.Login">
<result name="success" type="redirect-action">ListBooks.action</result>
<result name="error">/login.jsp</result>
<result name="input">/login.jsp</result>
        </action>


<action name="Logout" class="Action.Logout">

<result name="success">/login.jsp</result>
<result name="input">/login.jsp</result>
        </action>

<action name="DeleteOrder2" class="Action.DeleteOrder2">
<result name="success" type="redirect-action">ListOrder</result>
<result name="error" type="redirect-action">ListOrder</result>
</action>
<action name="Cart" class="Action.Cart">
<result name="success" type="redirect-action">ListBooks</result>

    </action>
    <action name="SessionBook" class="Action.SessionBook">
<result name="success">cart.jsp</result>

</action>

    <action name="DeleteSessionBook" class="Action.DeleteSessionBook">
<result name="success" type="redirect-action">SessionBook</result>

    </action>

    <action name="ListComments" class="Action.ListComments">
<result name="success">/listComments.jsp</result>

        </action>

    <action name="AdminLogin" class="Action.AdminLogin">
<result name="success" type="redirect-action">AdminOrder</result>
            <result name="error">/adminLogin.jsp</result>

        </action>
    <action name="SortBook" class="Action.SortBook">

            <result name="success">/sortBooks.jsp</result>

        </action>
</package>





<package name="AdminAction" extends="struts-default">
<interceptors>
<interceptor name="authority" class="Interceptor.AdminAuthority"/>
<interceptor-stack name="mydefault">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="authority"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="mydefault"/>

              

<global-results>
            <result name="admin">/adminLogin.jsp</result>
</global-results>
<action name="AdminListUser" class="Action.AdminListUser">
<result name="success">/adminAcount.jsp</result>
        </action>

<action name="AdminBook" class="Action.AdminBook">
<result name="success">/adminBook.jsp</result>
        </action>
<action name="BookDetail" class="Action.BookDetail">
<result name="success">/bookDetail.jsp</result>
        </action>
<action name="AdminCategory" class="Action.AdminCategory">
<result name="success">/adminCategory.jsp</result>
        </action>
<action name="AddCategory" class="Action.AddCategory">
<result name="success"  type="redirect-action">AdminCategory</result>
<result name="error" type="redirect-action">AdminCategory</result>
        </action>
<action name="DeleteCategory" class="Action.DeleteCategory">
<result name="success"  type="redirect-action">AdminCategory</result>
<result name="error" type="redirect-action">AdminCategory</result>
        </action>
<action name="AddBook" class="Action.AddBook">

  <interceptor-ref name="fileUpload"> 
                <param name="allowedTypes">image/bmp,image/png,image/gif,image/jpeg</param> 
                <param name="maximumSize">10000000</param> 
            </interceptor-ref> 
            <interceptor-ref name="defaultStack"/>     
  <param name="savePath">/upload</param>
<result name="success"  type="redirect-action">AdminBook</result>
<result name="error" type="redirect-action">AdminBook</result>
<result name="input" type="redirect-action">AdminBook</result>
</action>
<action name="DeleteBook" class="Action.DeleteBook">
<result name="success"  type="redirect-action">AdminBook</result>
<result name="error" type="redirect-action">AdminBook</result>
</action>
<action name="ListBooks" class="Action.ListBooks">
<result name="success" >/listBooks.jsp</result>
</action>
<action name="AdminOrder" class="Action.AdminOrder">
<result name="success" >/adminOrder.jsp</result>
</action>
<action name="DeleteOrder" class="Action.DeleteOrder">
<result name="success" type="redirect-action">AdminOrder</result>
<result name="error" type="redirect-action">AdminOrder</result>
</action>
<action name="DoItOrder" class="Action.DoItOrder">
<result name="success" type="redirect-action">AdminOrder</result>
<result name="error" type="redirect-action">AdminOrder</result>
</action>
<action name="SendMail" class="Action.SendMail">
<result name="success" type="redirect-action">AdminListUser</result>
<result name="error" type="redirect-action">AdminListUser</result>
</action>
</package>

</struts>
web.xml配置文件如下:
<?xml version="1.0" encoding="GBK"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 <welcome-file-list>
  <welcome-file>ListBooks.action</welcome-file>
  </welcome-file-list>

   <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>


    <filter> 
        <filter-name>struts-cleanup</filter-name> 
        <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> 
    </filter>
    <filter-mapping>
        <filter-name>struts-cleanup</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

 <servlet>
        <servlet-name>img</servlet-name>
        <servlet-class>validator.AuthImg</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>img</servlet-name>
    <url-pattern>/authImg</url-pattern>
    </servlet-mapping>

</web-app>
希望看到的帮忙解决下吧!!! --------------------编程问答--------------------   你怎么访问的 也贴下 404的错误路径信息 
补充:Java ,  Java EE
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,