Category "java"

Reversing strings in Java (loops) until "done"

this is a lab for class I'm trying to do. Here's the instructions: Write a program that takes in a line of text as input, and outputs that line of text in rever

How to put ImageView on top of CardView in ConstraintLayout

I want to create a layout like this, but I don't know how to place the CardView background under the ImageView and then set TextView below the image. The image

Split data in JSON file based on a key value using java

I have a json file with which has an array of product items i want to split them based on the category of the item, This is my json file looks like, { "item

RESTful web service: How can I take this data without printing out the other

I want to just take the data from menSize and its price but it keep printing out the womenSize eventhought it doesn't add anything in it. Do I need to seperate

Log4j 2: How to enable ANSI colours on Windows console?

I try to use Windows 10 command line to print colored messages on console, but with no success. According to the Log4j 2 documentation, I should add the Jansi j

Java: Find .bat files in all folders of a drive (C:\ and others) [duplicate]

Is there a Java code that will look in every folder of a given drive and search for .bat files? And return them has a ArrayList of Files? I'm

Global exception handling in spring webflux during tests

I'm developing a service with spring webflux. I implemented exception handling using @ControllerAdvice. It works pretty well, but when I run integration tests i

Spring cloud Netflix-Hystrix gradle dependency not allowing spring boot application to start

I have built simple microservice application using Spring-Boot and Eureka server. Now, I want to add fault-tolerance in case any of service registered in Eureka

Bi-directional relation in hibernate is failing to be cascadelly saved

I am using a Spring-Boot (2.3.3) application with Hibernate (5.4.20) and JPA repository on MySql DB, and I have a Bi-directional relationship between an entity:

How to write a generic base64 screenshot method using selenium 4 with java and attach it to extent report on test failure?

method used currently public static String getScreenshot(String screenshotName) throws IOException { String dateName = new SimpleDateFormat("yyyyMMddhhm

how to use if statement in main to Create an object with user input and to use a method on the objects

I'm working on an exercise, where I need to create a subclass that has 2 constructors (1 is empty and sets the values as 0 the other one is getting the values.

Error initializing QuantumRenderer: no suitable pipeline found in Eclipse JavaFX

Showing "Error initializing QuantumRenderer: no suitable pipeline found" after running JavaFX application. I added required JavaFX jar files to the project and

How to solve below problem of Drawing Book

Hackerrank problem Drawing Book. Brie’s Drawing teacher asks her class to open their books to a page number. Brie can either start turning pages from

Java @requestBody doesn't work, dto empty

For some reason java can't map DTO with requestBody and all values are default ones, as for request it works, with payload for ex. "{"productId":1,"commitment":

Java Excel/POJO Mapping in POI

Java 8 here using Apache POI 4.1 to load Excel (XLSX) files into memory, and write lists of Java beans/POJOs back to new Excel files. To me, an Excel file (at

Java System Logger on WildFly

Since JDK 9 we have a new Java Logging API: https://docs.oracle.com/javase/9/docs/api/java/lang/System.Logger.html https://www.baeldung.com/java-9-logging-api h

Enable http actuator with disable default web server

I need create spring boot application as daemon with disabled default web server and with active server actuator by http. I need actuator only by http no jmx.

ERROR Failed to load resource: the server responded with a status of 403 () en angular

Errors I get ERRORES: Failed to load resource: the server responded with a status of 403 () login:1 Access to XMLHttpRequest at 'http://localhost:8080/l

vs2019 - Xamarin: loses path settings of "Java Development Kit Location"

I do a very simple thing. I go to Tools -> Options -> Xamarin> Android Settings and I change the "Java Development Kit Location" path. I press ok. I co

The specified method is not allowed against this resource in Amazon aws

Guys I may or may not be wrong, But seriously, I am struggling with file uploading problem in Amazon S3 bucket. When I am trying to hit on the request then I am