Skip to content
Advertisement

Tag: spring-mvc

Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”?

I’m writing a Spring MVC application deployed on Tomcat. See the following minimal, complete, and verifiable example Where SpringServletConfig is Finally, I have a @Controller in the package com.example.controllers My application’s context name is Example. When I send a request to the application responds with an HTTP Status 404 and logs the following I have a JSP resource at /WEB-INF/jsps/index.jsp

Jackson is ignoring spring.jackson.properties in my spring boot application

Jackson is ignoring spring.jackson.property-naming-strategy=SNAKE_CASE. I am using springBootVersion 1.4.2.RELEASE. In my application.properties file, I have added spring.jackson.property-naming-strategy=SNAKE_CASE But Jackson is not honoring this property, and my REST response is still camelCase. Interestingly, this annotation works just fine @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) With this annotation, I am getting snake_case response. But I don’t want to annotate each response class, it’s a bit annoying. Edit

Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed

When I compile my spring project, I got the following error. Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed I am using STS Eclipse and MySql Database My Connection string in Application.Properties is The detailed error is given below Answer I would start by adding the following dependency: and UPDATE: Or

Why do I always get Whitelabel Error Page with status “404” while running a simple Spring Boot Application

My Controller My JSP (welcome.jsp) inside /WEB-INF/jsp (parent folder is WebContent) My pom.xml My App Initializer I even added thymeleaf dependency to my pom. It still didn’t work. When ever I hit localhost:8080/hello or /indexPage or /indexPageWithModel it always says Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed

Spring boot mapping static html

I want to create spring boot web application. I have two static html files: one.html, two.html. I want to map them as follows without using template engines (Thymeleaf). How to do that? I have tried many ways to do that, but I have 404 error or 500 error (Circular view path [one.html]: would dispatch back to the current handler URL).

Advertisement