No mapping found for HTTP request with URI in DispatherServlet

0 votes
While working with Spring MVC it responds with a 404 error and reported "No mapping found for HTTP request with URI[....] in DispatherServlet"?
Jun 2, 2018 in Java by poorvi
• 160 points
21,686 views

1 answer to this question.

0 votes

Your standard Spring MVC application will serve all requests through a DispatcherServlet that you've registered with your Servlet container.

The DispatcherServlet looks at its ApplicationContext and, if available, the ApplicationContext registered with a ContextLoaderListener for special beans it needs to setup its request serving logic. These beans are described in the documentation.

public InternalResourceViewResolver resolver() {
    InternalResourceViewResolver vr = new InternalResourceViewResolver();
    vr.setPrefix("/WEB-INF/jsps/");
    vr.setSuffix(".jsp");
    return vr;
}
added tomcat-embed-jasper:
<dependency>
       <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
       <scope>provided</scope>
</dependency>
answered Jun 6, 2018 by prasad
• 160 points

Related Questions In Java

0 votes
1 answer

No appenders could be found for logger(log4j)?

Just to get you going you have ...READ MORE

answered Jun 29, 2018 in Java by Akrati
• 3,190 points
8,734 views
0 votes
1 answer

JsonMappingException: No suitable constructor found for type [simple type, class ]: can not instantiate from JSON object?

Hello @kartik, his happens for these reasons: your inner ...READ MORE

answered Apr 8, 2020 in Java by Niroj
• 82,840 points
15,468 views
0 votes
1 answer

Error:No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call

Hii @kartik, If you have @Transactional // Spring Transactional class ...READ MORE

answered May 22, 2020 in Java by Niroj
• 82,840 points
49,824 views
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 81,222 views
0 votes
2 answers

Send HTTP request in Java

import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpRequest; import com.google.api.client.http.HttpResponse; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; import java.io.IOException; import ...READ MORE

answered Aug 3, 2018 in Java by samarth295
• 2,220 points
1,746 views
0 votes
1 answer
0 votes
1 answer

@Component vs @Repository vs @Service in Spring Framework

As you might be knowing, all these ...READ MORE

answered May 29, 2018 in Java by geek.erkami
• 2,680 points
3,651 views
+1 vote
13 answers

How to send HTTP POST requests on Java?

With Apache HttpClient In the old days, this Apache ...READ MORE

answered Dec 10, 2020 in Java by Rajiv
• 8,870 points
159,397 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP