Skip to content

Tag: java

How to add a field from body to a condition

I use the @StreamListener annotation to listen to the topic. How can I add a field from body to the condition? An example of an entity that is sent to the topic: Answer As you can see from version 3.0, you should avoid using filtering based on the message payload. Notice these lines from the documentation: Th…

antMatchers() is not working , and gives forbidden error

I have an end-point called authenticate , this endpoint is given to antMatchers(“/authenticate”) to skip authorization for this end-point, but it still checks for the authentication. code: Answer I have an update regarding the issue. In my case, I had a problem with a function singWith() that was …

Elasticsearch 7 – query with raw JSON of Kibana

Recently I’ve started using the Elasticsearch (7.6.x) with Java backend (I’m pretty much a beginner in ES) and I have a general question, I’ve searched for that but didn’t find an answer: My workflow goes like this: I open kibana’s dev tools console and come up with a query to se…

JOOQ Forced types to convert a BigInteger to BigDecimal for POSTGRES

for a Table , lets say myTable, I have a column myColumn.. the default JOOQ generation creates myColumn as BigInteger, I want to create it as BigDecimal. This is the converter I am using. How should be the forceType configuration look like in the XML file? Answer The reason why your columns are generated as B…

Logging access to Java servlet

I’m currently developing a Java Web application using Servlets. What I need to do is log to a file every access made to the website. To do that, I used Filters. So far, I’ve made it to the point where I can print everything to the console. What I now need to do is store that into a file with

How can I compare with ‘>’

I am working on a program using package for the FTC robotics tournament. My issue is with import com.qualcomm.robotcore.util.ElapsedTime; The variable runtime does not compare with an int as it is a Type ElapsedTime. I have tried just about every thing I could find and it either results in a compile or runtim…