When you work with Spring MVC and you have a RequestMapping to something like /elements/{id}, this binding will not work for elements having slash in their ids. This tutorial shows how to resolve resolve Spring...
Tagged: Spring-MVC
InvalidDefinitionException: Cannot construct instance of `org.springframework.data.domain.PageImpl` – Solution
When working with Spring MVC and calling a web service that returns a Page<Something>, you will encounter the error : com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of org.springframework.data.domain.PageImpl (no Creators, like default construct, exist): cannot deserialize from...
Spring MVC Convert Object to MultiValueMap
When using Spring MVC you may have to convert an Object to a MultiValueMap<String,String>. For example when you want to perform a HTTP call with parameters. This tutorial will show how to Spring MVC Convert Object...
Angular Spring Security CSRF configuration
CSRF (also known as XSRF) is a well known web security attack allowing hackers to steel your identity and perform requests on website where your are already logged into. This tutorial shows how to Angular...
Angular file upload Spring Boot
This tutorial shows a step by step solution to Angular file upload Spring Boot backend and store it on file system. We will cover a file upload from a basic input and also from...
Angular download file with Spring Boot
This tutorial shows a step by step solution to Angular download file Spring Boot backend. We will cover the download of files located in system and others in classpath. Server side This section covers...
Defining a proxy in Spring RestTemplate
By default, RestTemplate don’t use a proxy to make the http calls and if you work in an environment that requires one, you will encounter the following exception :
1 2 3 4 5 6 7 8 |
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://roufid.com": Connection timed out: connect; nested exception is java.net.ConnectException: Connection timed out: connect at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:633) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:588) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:295) Caused by: java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) ... 33 more |
This tutorial will show two...