Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 675

Error 404 on using servlets with Struts 2

$
0
0

I have all of the Struts jars included in WEB-INF/lib and imported to project. I am trying to migrate from simple servlets based project to Struts 2. I added a <filter> tag in web.xml and constant tag in struts.xml as per the tutorial, yet I get 404 on servlet invocation.

web.xml:

<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"><display-name>Solution</display-name><welcome-file-list><welcome-file>Login.jsp</welcome-file></welcome-file-list><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><servlet><display-name>LoginController</display-name><servlet-name>LoginController</servlet-name><servlet-class>com.tcs.controller.LoginController</servlet-class></servlet><servlet-mapping><servlet-name>LoginController</servlet-name><url-pattern>/LoginController</url-pattern></servlet-mapping></web-app>

struts.xml :

<!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.action.excludePattern" value="/LoginController"></constant><package name="default" extends="hibernate-default">    </package></struts>

error on JSP page :

HTTP Status 404 - There is no Action mapped for namespace / and action name LoginController.The requested resource (There is no Action mapped for namespace / and action name LoginController.) is not available.

Viewing all articles
Browse latest Browse all 675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>