Status: 404-Not found

CannonSuyash :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

 <bean id="viewResolver"
    class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
    <property name="prefix">
        <value>/WEB-INF/views/</value>
    </property>
    <property name="suffix">
        <value>.jsp</value>
    </property>
</bean>

Dispatcher-servlet-context.xml when i run my project it throw me 404 error

Web.xml This is my web XML file help me to configure dispatcher-servlet as front controller, both these files are present in WebContent\WEB-INF\web.xml folder

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
            <listener>
                <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
            </listener>

            <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/dispatcher-servlet-context.xml</param-value>
            </context-param>

            <servlet>
                <servlet-name>dispatcher-servlet</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
                <init-param>
                    <param-name>contextConfigLocation</param-name>
                    <param-value></param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
            </servlet>

            <servlet-mapping>
                <servlet-name>dispatcher-servlet</servlet-name>
                <url-pattern>/*</url-pattern>
            </servlet-mapping>
            <welcome-file-list>
                <welcome-file>/index.htm</welcome-file>
            </welcome-file-list>

        </web-app>
SongChay Beng :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
            <listener>
                <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
            </listener>
            <servlet>
                <servlet-name>dispatcher-servlet</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
                <init-param>
                    <param-name>contextConfigLocation</param-name>
                    <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
            </servlet>
            <servlet-mapping>
                <servlet-name>dispatcher</servlet-name>
                <url-pattern>/*</url-pattern>
            </servlet-mapping>          
           <welcome-file-list>
                <welcome-file>/index.htm</welcome-file>
            </welcome-file-list>
        </web-app>

try this and change your servelet file to dispatcher-servlet.xml

<`context`-param> is at different level from dispatcher-servlet. what you do is you put your servlet inside it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

HTTP Status 404 - Servlet not found

Servlet: HTTP Status 404 - Not Found

InMemoryWebApiModule - status: 404 - collection not found

Spring type=Not Found, status=404 No message available

Maven web project HTTP Status [404] – [Not Found]

Eclipse & Tomcat Error: HTTP Status 404 – Not Found:

HTTP 404 status code (Not Found) shown as 302

Spring Boot, Status 404, Error "Not Found"

HTTP Status 404 – Not Found Spring Boot

HTTP Status 404 – Not Found tomcat spring

HTTP Status [404] ? [Not Found] for /login in spring security

API request returning status code 404 not found

NOT FOUND (status code: 404): Unknown Message

HTTP Status 404 – Not Found on Tomcat server

JSP/JDBC: HTTP Status 404 - Not Found

HTTP Status 404 - Not Found - Servlet and JSP

"status": 404, "error": "Not Found", "path": "/GetProduct"

HTTP Status 404 – Not Found: for controller - no view resolvers found in Idea

Failed to load resource: the server responded with a status of 404 (Not Found). with ajax in caph

Microsoft Graph API status code 404 not found error

Insertion of image in mysql using jsp HTTP Status 404 not found

Spring Boot Whitelabel Error page (type=Not Found, status=404)

How to redirect "HTTP Status 404 – Not Found" to an error information page in tomcat?

Issue With Spring: There was an unexpected error (type=Not Found, status=404)

Spring Mvc get HTTP Status [404] – [Not Found] after the submission

Spring Mvc App get - HTTP Status [404] – [Not Found]

Ionic 4 - Unhandled Promise rejection: Error Status 404: App not found

Failed to load COMPASS resource: the server responded with a status of 404 (Not Found)

Failed to load resource: the server responded with a status of 404 (Not Found)