spring-mvc Questions
2
Solved
Below is my controller method definition
@Autowired
private HttpServletRequest request;
@PostMapping(path = "/abc")
public String createAbc(@RequestBody HttpServletRequest request)
throws IOExce...
Baize asked 12/9, 2019 at 0:56
10
Solved
I have noticed the following code is redirecting the User to a URL inside the project,
@RequestMapping(method = RequestMethod.POST)
public String processForm(HttpServletRequest request, LoginForm...
Cloutman asked 30/7, 2013 at 19:32
2
I was working on trying to make a call to my backend and have set up a simple controller like this.
@RestController
public class HelloController {
@RequestMapping("/hello")
public Stri...
Corporation asked 15/12, 2021 at 15:9
0
I'm testing spring boot compression property:
server.compression.enabled=true
I would like to validate that after sending a request with a header "Accept-Encoding":"gzip",
I wou...
Crowe asked 20/1, 2022 at 15:24
3
Solved
I want to enable the user to play a sound. My implementation works fine with firefox. On Safari the sound is not played. I verified, that the audio control works in safari with other websites. So, ...
Rattlesnake asked 7/2, 2019 at 8:57
7
I am trying to configure an interceptor in my application and I am not being able to make it work.
In my application configuration class, I have configured in the following way:
@Configuration
@E...
Slayton asked 25/3, 2014 at 11:53
3
I am upgrading a Spring Boot application from version 1.5.6 to 2.1.1. When I start the application, it gets stuck at this line:
INFO: Initializing Spring DispatcherServlet 'dispatcherServlet'
Wh...
Mandie asked 11/12, 2018 at 19:14
6
Solved
My existing Spring Web MVC application has the following handler mapping in the Controller.
@RequestMapping(method = RequestMethod.GET, value = "/welcome")
I trigger the following requesthttp:/...
Injector asked 13/3, 2012 at 16:30
1
how to bootstrap spring application with @Configuration within old web.xml ?
Say I am building a spring project with @Configuration @ComponentScan annotation style, then how do i get it working wit...
Brominate asked 17/1, 2022 at 12:58
8
Solved
Is there a way to pass an entire form object on mock request when integration testing a spring mvc web app? All I can find is to pass each field separately as a param like this:
mockMvc.perform(po...
Bodycheck asked 17/6, 2013 at 8:17
12
Solved
I'm facing a problem when using Spring Security && Thymeleaf, specifically when trying to use the hasRole expression. The 'admin' user has a role 'ADMIN' but hasRole('ADMIN') resolves to fa...
Agglomeration asked 11/6, 2015 at 17:58
3
Solved
I am getting error when i uploading 10 MB Size of csv file in Spring by using CommonsMultipartResolver library. I have done following setting in xml file
Xml File Confi :
<beans:bean id="multi...
Blocker asked 11/5, 2015 at 6:1
4
Solved
H, I want to upgrade Spring libraries in my web app. Since I am using Hibernate as well, I wanted to know if there is a way I could find which version of Hibernate is compatible with a specific ver...
Dipterous asked 2/8, 2013 at 12:57
2
I have a @ControllerAdvice class to handle exceptions from my SpringMVC controllers. I would like to catch an exception of a known type (RuntimeException) in an @ExceptionHandler method then throw ...
Solidus asked 29/3, 2016 at 10:43
3
Solved
I am using @TestPropertySource to overwrite application.yml properties in my integration test for a spring boot app.
@TestPropertySource(properties = { "repository.file.path=src/test/resources/x" ...
Enallage asked 22/11, 2015 at 14:26
4
I want to set active profile host dependent for any envrionment and cannot find an environment independent hook.
Following factory will set the active profile before application context will build...
Antinomian asked 7/3, 2017 at 10:46
2
Solved
We have a bunch of microservices based on Spring Boot 2.5.4 also including spring-kafka:2.7.6 and spring-boot-actuator:2.5.4. All the services use Tomcat as servlet container and graceful shutdown ...
Phosphoresce asked 16/12, 2021 at 11:26
3
I want to implement Spring endpoint in which I can return XML object NotificationEchoResponse and http status code. I tried this:
@PostMapping(value = "/v1/notification", produces = "application/x...
Contraceptive asked 26/6, 2019 at 20:3
7
I am trying to handle Validation exception in Spring Rest service like code given below:
@Produces("application/json")
@ExceptionHandler(MethodArgumentNotValidException.class)
@ResponseStatus(Ht...
Lardner asked 14/7, 2014 at 7:29
6
Solved
How can I specify order of my Filter in spring-boot? I need to insert my MDC filter after Spring Security filter. I tried almost everything but my filter was always first. This didn't work:
@Bean
...
Norean asked 21/9, 2014 at 9:41
12
Solved
I have successfully built my Spring MVC project with mvn clean package by following this tutorial.
Now I am trying to run the service with:
mvn clean package && java -jar target/gs-servin...
Subhead asked 27/10, 2013 at 16:20
3
Solved
I use Spring Security 3.1.4 to secure a Spring MVC 3.2.4 application deployed to Tomcat. I have the following Spring Security configuration:
<http auto-config="true" use-expressions="true">
...
Canady asked 15/12, 2013 at 3:10
1
Solved
I'd like to secure all pages in "/static/secure" in Spring Boot utilizing Spring Security, but I do not wish to utilize a view.
I have created a login form, with method="POST", and have setup Jav...
Checked asked 7/9, 2017 at 1:34
2
Solved
I'm investigating using @Scheduled at a fixed rate where in some configurable circumstances the scheduled job should never be run.
The documentation doesn't mention this but the default values for...
Fridafriday asked 5/10, 2015 at 10:33
2
Spring @CrossOrigin annotation does not work with DELETE methods.
Example code (in Groovy):
@CrossOrigin
@RestController
@RequestMapping('/rest')
class SpringController {
@RequestMapping(value ...
Cristoforo asked 19/5, 2017 at 10:37
© 2022 - 2024 — McMap. All rights reserved.