Skip to content
Advertisement

Tag: java

400 Bad Request when using Spring Boot

I am sending a Http POST request to my RESTful API build with Spring Boot and get the “400 Bad Request” response. My POST request is made with Postman, send to with the body I want to pass the filename variable to my Java Method. My RESTful api is build in Java with Spring Boot I tried with and with

non-capturing group still shows?

I am trying to get the string starting from third / in a url. here is the url: http://192.168.1.253:18888/2021/03/11/896459e4-875f-455a-a2cb-768c879555e7.png I wish to get /2021/03/11/896459e4-875f-455a-a2cb-768c879555e7.png So I used the following regex (?://.+)/.+ ?: marks a non-capturing group, so //192.168.1.253:18888 shouldn’t be matched. But when I test in regex101.com, its result is //192.168.1.254:18888/2021/03/11/896459e4-875f-455a-a2cb-768c879555e7.png. Why is that? Answer The reason the regex101.com result

How to specify role at node level within Akka cluster?

Given the following appliction.conf : To discern between the roles within an Actor I use : edited from src (https://doc.akka.io/docs/akka/current/cluster-usage.html) To enable role for a node I use the following config : Within application.conf I configure the array for the roles but this appears to be at the cluster level rather than node level. In other words it does not

Immutable class while using a cache

While going through JCIP, I came across the below code snippet which was considered as Immutable. However the explanation provided makes me confused. OneValueCache wouldn’t be immutable without the copyOf calls in the constructor and getter. Arrays.copyOf was added as a convenience in Java 6; clone would also work. Aren’t the state vars of OneValueCache themselves Immutable with final and

Advertisement