Skip to content
Advertisement

javax’s @Valid annotation usage scenario

Is it possible to use @Valid (javax.validation.Valid) in below scenario? Here JsonStringToObjectConvertor is taking in JSON in form of String and mapping it to IncidentModel class. I have defined few validations in IncidentModel in below manner and I want to validate the fields mapped by ObjectMapper in IncidentModel before proceeding further: It does not seem to work in the above

Java program uses wrong locale when jpackaged

I am parsing strings representing German-style numbers (i.e., decimal comma and optional full stop for grouping thousands), e.g., “2.804,13”; this is just done using a DecimalFormat based on my desired Locale: This gives the desired output, e.g., when compiled and run from the command line: However, when I bundle it as a jpackage image (./gradlew jpackageImage using Gradle and the

How to handle Docker-Secrets in application.properties files

How do you inject Docker secrets (files/data from /run/secrets) into the application.properties files? Is it safe to use environment variables? Answer First of all, usage of environment variables for secret data for the application.properties isn’t safe. You have mainly two options when talking about Secrets. If you are using Docker Secrets without Docker Swarm then you can directly load the

Put sin on segment in 3d

i need to put a sin function, or any other function on start of segment in 3d space. Something like that: Example But in 3d space, help me pls, i spent about 4 days for solving it, but did not get result There are 2 points in space at arbitrary positions. I need a sinusoid between these two arbitrary points.

Use another MapStruct mapper only inside an expression clause

I have a mapper that, for a particular attribute of the target class, needs to choose one from a list of objects inside the source object, and map it using a differente mapper class. Simplifying it a lot, the Game class contains a list of Transaction objects, and my GameMapper class looks like this: The thing is, EventMapper gets generated

Advertisement