tagged [spring-mvc]

Is Spring ever going to combine MVC and WebFlow?

Is Spring ever going to combine MVC and WebFlow? I thought I read Juergen Holler somewhere once in the past say that a future goal of Spring was to combine Spring MVC and WebFlow... Is this still the ...

How return error message in spring mvc @Controller

How return error message in spring mvc @Controller I am using methods like this ``` @RequestMapping(method = RequestMethod.GET) public ResponseEntity getUser(@RequestHeader(value="Access-key") String ...

7 Sep at 15:23

Difference between Interceptor and Filter in Spring MVC

Difference between Interceptor and Filter in Spring MVC I'm a little bit confused about `Filter` and `Interceptor` purposes. As I understood from docs, `Interceptor` is run between requests. On the ot...

8 Mar at 00:14

Spring Boot Program cannot find main class

Spring Boot Program cannot find main class I have a program which runs as a Spring boot App in eclipse. The program was running fine. Then i did the following: Right click on project -> Run As -> Mave...

11 Feb at 09:47

This application has no explicit mapping for /error

This application has no explicit mapping for /error I used maven to do the tutorial [https://spring.io/guides/gs/uploading-files/](https://spring.io/guides/gs/uploading-files/) All the codes I used wa...

2 May at 20:22

How to convert a multipart file to File?

How to convert a multipart file to File? Can any one tell me what is a the best way to convert a multipart file (org.springframework.web.multipart.MultipartFile) to File (java.io.File) ? In my spring ...

Spring MVC - How to get all request params in a map in Spring controller?

Spring MVC - How to get all request params in a map in Spring controller? Sample URL: I do not know the names of attr1, att2, and attr4. I would like to be able to do something like that (or similar, ...

6 Dec at 13:39

passing JSON data to a Spring MVC controller

passing JSON data to a Spring MVC controller I need to send a JSON string to Spring MVC controller.But I do not have any form bindings to it , I just need to send a plain JSON data to Controller class...

6 Oct at 07:10

How to accept Date params in a GET request to Spring MVC Controller?

How to accept Date params in a GET request to Spring MVC Controller? I've a GET request that sends a date in YYYY-MM-DD format to a Spring Controller. The controller code is as follows: The request is...

19 Dec at 01:48

Spring security 2.0.5. custom login form. Cannot see errors in language other than English

Spring security 2.0.5. custom login form. Cannot see errors in language other than English I've got my Spring Security custom login form working. It displays errors if the user has input bad credentia...

How to get active user's UserDetails

How to get active user's UserDetails In my controllers, when I need the active (logged in) user, I am doing the following to get my `UserDetails` implementation: It works fine, but I would think Sprin...

Increase HTTP Post maxPostSize in Spring Boot

Increase HTTP Post maxPostSize in Spring Boot I've got a fairly simple Spring Boot web application, I have a single HTML page with a form with `enctype="multipart/form-data"`. I'm getting this error: ...

20 Oct at 09:46

JSON character encoding

JSON character encoding My Java web application submits an AJAX request that returns JSON such: When 'aériennes' is displayed in the webpage, it appears as 'a�riennes', so I guess there's some kind of...

Set Jackson Timezone for Date deserialization

Set Jackson Timezone for Date deserialization I'm using Jackson (via Spring MVC Annotations) to deserialize a field into a `java.util.Date` from JSON. The POST looks like - `{"enrollDate":"2011-09-28T...

14 Nov at 14:2

What is the best way to return different types of ResponseEntity in Spring-Boot (Error Handling for REST with Spring)

What is the best way to return different types of ResponseEntity in Spring-Boot (Error Handling for REST with Spring) I have written simple REST application in `Spring Boot` (`Spring` Framework). It r...

What's the difference between <mvc:annotation-driven /> and <context:annotation-config /> in servlet?

What's the difference between and in servlet? I am migrating from Spring 2.5 to Spring 3. They have introduced `` which does some black magic. This is expected to be declared in servlet configuration ...

6 Dec at 17:33

How do I use Spring Boot to serve static content located in Dropbox folder?

How do I use Spring Boot to serve static content located in Dropbox folder? I have a Spring Boot web application, and I would like to serve static content located in a shared Dropbox directory on my L...

Passing multiple variables in @RequestBody to a Spring MVC controller using Ajax

Passing multiple variables in @RequestBody to a Spring MVC controller using Ajax Is it necessary to wrap in a backing object? I want to do this: And use a JSON like this:

21 Mar at 20:5

How to use Collections.sort() in Java?

How to use Collections.sort() in Java? I got an object `Recipe` that implements `Comparable` : I've done that so I'm able to sort the `List` alphabetically in the following method: ``` public static C...

9 Jan at 05:33

Spring MVC Multipart Request with JSON

Spring MVC Multipart Request with JSON I want to post a file with some JSON data using Spring MVC. So I've developed a rest service as ``` @RequestMapping(value = "/servicegenerator/wsdl", method = Re...

25 Mar at 13:28

When using Spring Security, what is the proper way to obtain current username (i.e. SecurityContext) information in a bean?

When using Spring Security, what is the proper way to obtain current username (i.e. SecurityContext) information in a bean? I have a Spring MVC web app which uses Spring Security. I want to know the u...

UTF-8 encoding problem in Spring MVC

UTF-8 encoding problem in Spring MVC I' ve a Spring MVC bean and I would like to return turkish character by setting encoding UTF-8. but although my string is "şŞğĞİıçÇöÖüÜ" it returns as "??????çÇöÖü...

What's the difference between @Component, @Repository & @Service annotations in Spring?

What's the difference between @Component, @Repository & @Service annotations in Spring? Can [@Component](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/stereotype...

17 Feb at 13:10

@RequestParam in Spring MVC handling optional parameters

@RequestParam in Spring MVC handling optional parameters Is it possible for a Spring controller to handle both kind of requests? 1) `http://localhost:8080/submit/id/ID123432?logout=true` 2) `http://lo...

15 Feb at 15:14

How can I implement a redirect-after-post form with Spring's AnnotationMethodHandlerAdapter?

How can I implement a redirect-after-post form with Spring's AnnotationMethodHandlerAdapter? I would like to write a @RequestMapping style form controller that redirects after a validation error and r...

3 Feb at 08:21