vendredi 24 novembre 2017

struts2 configuration:page 404 not found

The error message is as follows :

HTTP Status 404 – Not Found
Type Status Report
Message /MyMall/mylogin.action
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

In my JSP:

<form class="form-horizontal" style="width: 70%;margin: 0 auto;" role="form" action="${ pageContext.request.contextPath }/mylogin.action"
method="post">

In my web.xml:

<filter>
            <filter-name>struts2</filter-name>
            <filter-class>
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
        <filter-mapping>
            <filter-name>struts2</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

In my struts.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://ift.tt/18p24sP">
<struts>
    <constant name="struts.action.extension" value="action"></constant>
    <constant name="struts.devMode" value="true"></constant>
    <package name="default" extends="struts-default">
        <global-results>
            <result name="" type=""></result>
        </global-results>   
        <action name="mylogin" class="com.leaf.myMall.web.action.PersonAction"
            method="login">
            <result name="success" type="redirect">/myIndex.jsp</result>
            <result name="failer">/myIndex.jsp</result>
        </action>   
    </package>
</struts>

At first,I want to post my Java code,but I added a breakpoint in Java and I didn't get it. And I don't know how to debug these code. I am searching for a long time on net like google. But no use. Please help or try to give some ideas how to achieve this. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire