Error 404 means that the requested resource is unavailable, the same applies to an action that does not match the request URL.
FilterDispatcher deprecated and may not work with the current version of Struts, use StrutsPrepareAndExcecuteFilter .
<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 struts.xml add the following
<package name="default" extends="struts-default" namespace="/"> <action name=""><result>/Login.jsp</result></acton>
this will take you to the login page. Also consider using absolute paths to JSP resources.
In JSP, use a form that needs to be rewritten to
<s:form namespace="/" action="login" method="post"> <s:textfield name="username" key="label.username" size="20" /> <s:password name="password" key="label.password" size="20" /> <s:submit key="label.login" align="center" /> </s:form>
In the action attribute, use the name of the action and specify namespace , as it was in the package configuration.
Using method="execute" useless in the s:submit tag, the execute method is used by default, and it will not work because you disabled DMI in the Struts configuration.
Adding libraries on top of old libraries to WEB-INF/lib does not help, and your application probably does not work until you uninstall and replace all libraries of a lower version with a higher version and add new libraries necessary for the current version of the Framework Struts.
source share