spring-mvc Questions

10

Solved

I am connecting to a MongoDB sharding server via mongodb java driver in Spring MVC. I am using the following versions: spring-webmvc-3.2.1.RELEASE mongo-java-driver/2.10.0/mongo-java-driver-2.10....
Meryl asked 24/10, 2013 at 2:45

3

Now, my understanding, in general, is that @RequestMapping methods need to be public. Can they also be private? If so when would we use this? The reason why I am asking this is that I noticed that...
Ambur asked 28/5, 2018 at 9:49

4

Solved

I'm playing around with Spring Boot 2.0.0M2, trying to create a CLI application, not a web one. My problem is that even including compile 'org.springframework.boot:spring-boot-starter' compile ...
Cheeky asked 28/6, 2017 at 16:14

4

Solved

I have a file uploading api which was working perfectly fine under the spring boot version 2.1.13. After upgrading the version to 2.5.2, it started to throw an exception. Looking at the changelogs,...
Marilynnmarimba asked 13/8, 2021 at 1:49

5

I'm building a backend using Spring Boot 3.1.0-SNAPSHOT, which uses Spring Framework 6x. Interceptor: @Slf4j public class MyInterceptor implements HandlerInterceptor { @Override public boolean p...
Saxena asked 6/4, 2023 at 12:52

3

Solved

By Default, Spring Boot Application searches thymeleaf templates under classpath://templates How do we add one more resolver For E.g, We need to search templates from local directory like "c:\MyTe...
Gobbledegook asked 6/8, 2014 at 8:58

2

Solved

Currently, I am working on a project to upgrade it to Spring Boot 3, Spring 6, and Java 17. But I am facing an issue with HttpStatus. I have a method that returns HttpStatus.NO_CONTENT and HttpStat...
Mixedup asked 19/7, 2023 at 8:23

1

Solved

In my sample application I have a simple @RestController controller: package app.springtest.api.book; import app.springtest.service.BookService; import lombok.RequiredArgsConstructor; import lomb...
Onagraceous asked 10/5, 2019 at 13:22

2

The @ControllerAdvice annotation allows us to write global code applicable to a wide range of controllers. My Question is: @ControllerAdvice is applicable to only controller level and Spring AOP...
Matutinal asked 19/9, 2019 at 5:42

5

I want to ask about Architectural pattern. I write two snippet code to demo what I ask. The first way is: //a method on controller layer (in Spring framework) @RequestMapping(...) public ShopDTO f...
Roshelle asked 23/11, 2017 at 13:44

1

The Spring doc states @RequestParam relies on type conversion via a registered Converter or PropertyEditor while @RequestPart relies on HttpMessageConverters taking into consideration the 'Content-...
Etheline asked 28/8, 2022 at 18:45

6

Solved

I'm currently working on a Spring MVC application and I need to add a custom field to my Spring Security log-in user right when I log in (I insert username, password, custom value). This value need...
Thorn asked 20/1, 2017 at 18:27

8

Solved

I am having the property file with the following values. I want to read all the properties with same prefix excluding others using spring mvc. test.cat=cat test.dog=dog test.cow=cow birds=eagle ...
Gazette asked 18/12, 2017 at 17:6

5

Solved

I have a thymeleaf form which has 2 hidden fields. I specify the value of the hidden fields using th:value, and I bind these fields to an object. <div class="w-row"> <div class="w-col w...
Hype asked 12/9, 2014 at 12:31

3

Solved

I am trying to find way through which, I can populate all Key values from @RequestHeader annotation to a Map. I tried to Google it but all I can find is a way to map each key value to one parameter...
Salado asked 18/7, 2016 at 12:10

15

Solved

I am running spring-boot on an embedded tomcat server through maven with mvn clean install spring-boot:run. But every time I run it I get this error: Caused by: java.lang.IllegalArgumentException:...
Staples asked 8/1, 2018 at 21:22

7

I'm using Spring MVC as a rest controller and I've integrated Swagger-ui with my controller using Springfox. I'd like to have a method that is able to upload a file via the Swagger-ui interface. I ...
Hoem asked 15/7, 2015 at 1:45

7

Solved

My Controller @Controller //@RequestMapping("/") //@ComponentScan("com.spring") //@EnableAutoConfiguration public class HomeController { @Value("${framework.welcomeMessage}") private String mes...
Melly asked 22/9, 2016 at 1:37

2

Solved

there are few answers to the question already. But none of them works for me. I can't figure it out for the life of me why the error is coming. Following are the approaches I tried: using Abst...
Bracer asked 28/4, 2018 at 14:31

1

My use case: On user request create tmp file (I don't really need to create real file, but I need to have java.io.File instance) Process this file Return file and other meta data as json Remove ...
Criss asked 24/11, 2017 at 17:14

6

Solved

Error is as shown below. The problem is, occurring as below, this XmlWebApplicationContext need not occur, since it's injecting the bean again. How to avoid it? org.springframework.web.context.sup...
Cannes asked 8/9, 2015 at 7:28

7

I created a project with spring boot 2.1.1 and when I try to lift it I get the following error: 2018-12-10 19:23:14.837 ERROR 8096 --- [ main] o.s.boot.SpringApplication : Application run failed...
Cota asked 10/12, 2018 at 22:33

2

Solved

Using Spring MVC, I have controllers already working for both JSON and XML media formats. In the content negotiation configuration, I would like to rely on Accept header only, and introduce a custo...
Vignola asked 28/11, 2014 at 9:20

3

Solved

I'm trying to build a set of constraint validators for my Spring Boot application. I want to build some validation annotations like @NotNull. Btw: The validations should support validation groups. ...
Dufresne asked 11/12, 2017 at 12:21

3

Currently, I am using Spring Boot Starter 3.1.3. I need to make calls to some Rest endpoints. There is RestTemplate which I can use. Also, I have seen there are WebClient (sync and async) and RestC...
Educatee asked 2/9, 2023 at 16:2

© 2022 - 2024 — McMap. All rights reserved.