Category "java"

Truncating big text value in p:dataTable and exporting the table with the full text

I am using Primefaces 3.5 with JSF 2 and have a dataTable: <p:dataTable id="dataTable" var="refType" value="#{rtmUiController.listAllRefTypes()}" pag

Automatically perform action in client side when the session expires

I want to display in a <p:growl> that the session has expired. I found many methods to handle session expiration like: Session timeout and ViewExpiredExce

Not-null property references a transient value - transient instance must be saved before current operation

I have 2 domain models and one Spring REST Controller like below: @Entity public class Customer{ @Id private Long id; @OneToOne(fetch = FetchType.EAGER) @Joi

VScode complains that Java project has no explicit encoding set

I have been using vscode with no problems until recently. Now no errors show up, some variables never change color. And I have a constant error message: Projec

Merge Map<String, List<String> Java 8 Stream

I would like to merge two Map with JAVA 8 Stream: Map<String, List<String>> mapGlobal = new HashMap<String, List<String>>(); Map<Str

count number of digit using recursive method

Given a non-negative int n, compute recursively (no loops) the count of the occurrences of 8 as a digit, except that an 8 with another 8 immediately to its left

Adding a JScrollPane to a JMenu

I have a JMenu which will include JMenuItems that are generated on start-up from a database. As such, it's quite likely that the menu will be too large and run

Java Hibernate - is it possible to save the result to the database without commit, so that I can use sql / hql to verify data and rollback if needed?

I'm using Java with Hibernate. I want to: Save my data to the database Run sql to verify the result If the result is valid, then commit, otherwise rollback So,

Android Firebase: Set Value not working

I am trying to add an test value to Firebase Database by following code: FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference ref = F

JSON object showing null pointer exception

I want to post data to the url and getting Null pointer exception My JSON URL contains { "Details": [ { "Status":"NO UPDATES" }

Spring , How to have Swagger UI send a request without Hypertext Transfer Protocol

Is there a possibility to instruct Swagger not to send the Hypertext Transfer Protocol (http) in front of a POST or GET request ? As you can see on the screens

Flutter: Could not compile build file 'build.gradle', General error during semantic analysis: Unsupported class file major version 57

I try to develop an app using Flutter. Everything is OK when I initiate my app, it runs perfect for 2 days. But when I had an error writing my widgets, I restar

Get org.hibernate.LazyInitializationException in spring boot integration test

I'm trying to write integration test for Spring Boot application. I have Product and GalleryImage domain model. They are in one-to-many relationship. public cl

Can't find @Nullable inside javax.annotation.*

I want use @Nullable annotation to eliminate NullPointerExceptions. I found some tutorials on the net, I noticed that this annotation comes from the package j

Creating a simple Hello world Android Client-Server program

To keep it simple, all I'm trying to do is to send a message from my Android Emulator to a Java console server on Eclipse that contains a simple string, then I

Removing Java 8 JDK from Mac

So I installed the beta of JDK 8 a while ago to look at some of the examples. I thought for sure by now, it's easy to change between versions. Doing some Play

Setting default values to null fields when mapping with Jackson

I am trying to map some JSON objects to Java objects with Jackson. Some of the fields in the JSON object are mandatory(which I can mark with @NotNull) and some

Connect Remote Database using Selenium Webdriver and run Test Cases from local machine through eclipse

I am using selenium web driver java built, the editor is eclipse. For testing one of our websites I am using Data-driven testing by fetching data from MySQL dat

Spark saveAsTextFile() results in Mkdirs failed to create for half of the directory

I am currently running a Java Spark Application in tomcat and receiving the following exception: Caused by: java.io.IOException: Mkdirs failed to create file:/

Google SignIn API Exception 10

Approaching to the final stage of the authentification, but something is going wrong in handleSignInResult method. It returns Exception code 10 (Developer error