Questions tagged [spring-web]

The Spring Web model-view-controller (MVC) framework.

The Spring Web model-view-controller (MVC) framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, locale, time zone and theme resolution as well as support for uploading files. The default handler is based on the @Controller and @RequestMapping annotations, offering a wide range of flexible handling methods. With the introduction of Spring 3.0, the @Controller mechanism also allows you to create RESTful Web sites and applications, through the @PathVariable annotation and other features.

Official Documentation

389 questions
5
votes
1 answer

Solve the error java.io.StreamCorruptedException: Inconsistent vector internals

I have a Spring webapp that uses HttpInvoker to connect to a Spring Boot service. I have recently updated the service project to use Java 11 and at the same time updated it to Spring Boot starter 2.1.3.RELEASE. The service project provides an…
Ben
  • 183
  • 1
  • 4
  • 18
5
votes
2 answers

Spring Boot default exceptions mapped to standard HTTP status codes

I know it is possible to define custom exception handlers in Spring Boot and have e.g. the IllegalArgumentException exception mapped to the HTTP 400 Bad Request. I am wondering are there any existing exceptions defined in Spring Web/Boot mapped to…
Adam Siemion
  • 14,533
  • 4
  • 47
  • 84
5
votes
1 answer

Spring Boot WebFlux NettyServerCustomizer does not work

I have very simple application, I read I can use NettyServerCustomizer to customize NettyServer. But it does not work, implementation of the NettyServerCustomizer interface is not being called. Project is generated by Spring Initializr Code of…
Simon
  • 847
  • 1
  • 12
  • 23
5
votes
0 answers

Spring Boot 2 - EmbeddedServletContainerFactory not found

My Spring Boot 2 web application is working fine but now I want to redirect all http requests to https. However EmbeddedServletContainerFactory and TomcatEmbeddedServletContainerFactory can not be imported. It says that…
Vmxes
  • 1,333
  • 14
  • 24
5
votes
0 answers

What is the use of outputStreaming in SimpleClientHttpRequestFactory?

I am using OAuth2RestTemplate class of spring-security-oauth2-2.1.1.RELEASE for rest client services. Ideally, whenever an access token expires, the template should retry the failed request by fetching the new access token. But at times, when an…
5
votes
2 answers

How to set a context root for all @RestController in Spring Web MVC?

I'm looking to define /api as the root context for all my @RestControllers and don't want to specify it for each of them. For instance, I would like to write @RestController("/clients") instead of @RestController("/api/clients") and make my request…
Anthony O.
  • 16,644
  • 12
  • 92
  • 151
5
votes
1 answer

Partial JSON retrieval with RestTemplate

I'm using Spring RestTemplate to send GET request to the third-party service. It returns huge JSON which represents a list of some entities. But every entity is really big and contains tons of unnecessary data. I need to get only three fields from…
Alesto
  • 599
  • 1
  • 10
  • 26
5
votes
2 answers

Why jQuery rounds value?

Using ajax i request a authenticationID like this: This is wrong because the real HTTP-Transfer is this: (By the way: response-type is "application/json;charset=UTF-8") I see a clash between -1369082024195183657 and -1369082024195183600 How to…
Grim
  • 4,939
  • 8
  • 46
  • 97
5
votes
0 answers

Use @Transactional on Spring Rest CompletableFuture result

In my current web application, i use @RestController with CompletableFuture result for all services. Database operations are asynchronous (CompletableFuture methods), but i would like commit operations only before send result i would like to commit…
Fabien
  • 75
  • 1
  • 5
5
votes
3 answers

The value of the HTTP header ' SOAPAction ' was not recognized by the server

When I send a SOAP request to the server it returns following error, though I send similar request using SoapUI and that works. It seems I need to change my SOAP request to the one that I am sending using SoapUI. WSDL is here. [ truncated ]…
Daniel Newtown
  • 2,693
  • 8
  • 25
  • 60
5
votes
1 answer

How can I use multiple Oauth2 SSO Servers on a single Spring boot application with Spring Cloud Security Oauth2?

I'd like to give users the option to login to a Spring Boot web application using their Google or Facebook account. I checked The Spring Cloud Security documentation and also This GitHub issue to add such SSO functionality, but on both they only…
Raul G
  • 413
  • 1
  • 4
  • 18
5
votes
0 answers

Spring 4.2: CacheControl doesn't allow no-store and no-cache header

We are migrating a project from spring-web 4.1.8 to 4.2.3 and need to replace the deprecated code WebContentInterceptor interceptor = new…
NOTtardy
  • 154
  • 6
4
votes
2 answers

How to create a non-blocking @RestController webservice in spring?

I'm having a @RestController webservice method that might block the response thread with a long running service call. As follows: @RestController public class MyRestController { //could be another webservice api call, a long running database…
membersound
  • 66,525
  • 139
  • 452
  • 886
4
votes
1 answer

Spring WebFlux - Content type 'application/xml' not supported for bodyType=org.springframework.web.multipart.MultipartFile

I am using spring-webflux and want to upload files .... everything works great with just spring-web but when it comes to webflux i have not a clue what's wrong . Be careful in the difference ... i am using :
GOXR3PLUS
  • 5,939
  • 3
  • 30
  • 79
4
votes
0 answers

Is there any benefit using Spring WebFlux over Spring MVC when paired with the blocking Spring Data JPA (or JOOQ)?

I wanted to find a good answer for this, but couldn't really find one. Most comments and articles just cite the fact that your whole stack should be reactive to get the full benefits. But that kinda suggests to me that there are some benefits of…
1 2
3
25 26