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

386 questions
1
vote
3 answers

Spring Boot CORS configuration issue - Access-Control-Request-Method: POST

I have a CORS config: @Bean CorsConfigurationSource corsConfigurationSource() { LOGGER.info("Configuring CORS"); CorsConfiguration configuration = new CorsConfiguration(); …
mikeb
  • 10,578
  • 7
  • 62
  • 120
1
vote
1 answer

spring boot using HATEOAS generates links without host and port

I am using spring boot version 2.0.6 which comes with HATEOAS version 0.25. I am using a resource assembler that utlises ControllerLinkBuilder to generate resource links. However, the problem is it generates relative links, how to configure it to…
Anadi Misra
  • 1,925
  • 4
  • 39
  • 68
1
vote
1 answer

How create a webscript that return the output progressively?

We have a really long process an we want to trigger that progress with a webscript's endpoint But because it is too long with too many steps, we want to write in the body the steps accomplished and I want them to be display into the client browser…
Troncador
  • 3,356
  • 3
  • 23
  • 40
1
vote
1 answer

springSecurityFilterChain - ObjectPostProcessor is a required bean Exception

I am building a Spring Boot application with Spring Security (spring-boot-starter-web and spring-boot-starter-security). I receive the following error from my application during boot: org.springframework.beans.factory.BeanCreationException:…
Josh Maag
  • 633
  • 8
  • 20
1
vote
2 answers

How to whitelist only subpath of a secured path in Spring?

I'm using spring-boot-starter-security that automatically secures all of my @GetMapping rest endpoints by default. Question: how can I explicit only whitelist a subpath that should not be secured? I tried as follows: @Configuration public class…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
1
vote
1 answer

Spring Framework 3.2.5 - Issue decoding the response body of a POST API output

I just spent 5 hours trying to solve this issue but I've made zero progress. I've tried all the solutions I could find but I'm stuck. Here's my basic setup and the issue that I'm facing: Basic Setup I have 2 functions - 1) callGetApi(String url) 2)…
MGoyal92
  • 31
  • 3
1
vote
1 answer

Java RestTemplate hangs on 204 status code response

I'm creating test framework and using RestTemplate class for HTTP request creation. In general cases I use next code: Response response = null; ResponseEntity responseEntity = null; try{ responseEntity =…
1
vote
1 answer

is there any library or solution for spring response with long time needed job

Some process in my project needed a few minutes(1~10min). and I provide the result of this process using spring boot web. so my API have to return the response with status(queueing/running/finished/failed). so I made kind of this attributes…
rura6502
  • 365
  • 2
  • 15
1
vote
0 answers

DefaultUriBuilderFactory in 5.1.0.RC3 no longer encodes space in queryParam() value

I see that Spring Web 5.1.0.RC3 changed the DefaultUriBuilderFactory default EncodingMode from URI_COMPONENT to TEMPLATE_AND_VALUES. With this change, I found that when I call, for example, on a UriBuilder instance from the…
Rich
  • 21
  • 3
1
vote
1 answer

how to access object anywhere in the application after startup

I have some countries list in map in a class. Now I want to access this map in my application in some other classes. Basically I want this map available throughout the application. I am getting countries list in boot application just after startup.…
Anjali
  • 1,623
  • 5
  • 30
  • 50
1
vote
1 answer

Deploying Spring-boot web project in TomEE 7.1.0

I have created a simple spring boot web based project from STS, here is my pom file.
1
vote
2 answers

How to encode comma in Spring UriComponentsBuilder?

I have following code: String convertedBuilder = builder.toUriString(); convertedBuilder = convertedBuilder.replace(",", "\\,"); URI uri = UriComponentsBuilder.fromUriString(convertedBuilder) .build().toUri(); The idea…
Luís Palma
  • 249
  • 1
  • 7
  • 15
1
vote
2 answers

spring boot application with both front end and restful

I am Planning to build a web application using Spring Boot as restful service. my spring boot web restful application should be accessible by other application as well. In case if any one accessing the rest service from other application then my…
1stenjoydmoment
  • 229
  • 3
  • 14
1
vote
1 answer

How to inject single json parameter value in @PostMapping

I have a simple POST servlet and want to inject only one single property of a JSON request: @RestController public class TestServlet { @PostMapping(value = "/test", consumes = APPLICATION_JSON_VALUE) public String test(@Valid @NotBlank…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
1
vote
1 answer

TCP socket client using Spring Boot Web

I'm developing a web application using Spring Boot Web and I want to communicate with a TCP socket server using IP and Port (connect, send, receive and disconnect). I'm new to Spring Boot and I searched many days in the internet without any working…
Hicham
  • 41
  • 1
  • 2
  • 6