ClientResource null attributes

Java
I have an issue with ClientResource. When I initialize, the attributes are null. String url = "..." ClientResource clientResource = new ClientResourc...
2 years ago

Can't figure out why this isn't working (Checking if two references are the same in an array using a loop)

Java
I know this is messy, and sorry if this isn't the right place to ask these kinds of questions. If it isn't, I'll go ahead and delete this. I have this...
2 years ago

Error Decrypting JWE

Java
Kind of new to the JWE Decryption thing. I have a server that performs the JWE and sent it to client based on a key that is shared between server and ...
2 years ago

Calculating Pi Java Program

Java
I'm taking my first Java programming class and this is my first class project. I'm so confused about how to approach it. Any help or correction will b...
2 years ago

Is regex from Java buggy or am i missing something?

Java
With this regex : private static String p = "^\\(([-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?))\\,([-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?))\\...
2 years ago

Why does the Collections.shuffle() algorithm work better than my implementation

Java
Collections.shuffle() goes through each index of a Collection backwards and then swaps it with a random index including or before it. I was wondering ...
2 years ago

Accessing static variable from an object in memory

Java
Recently, I learned that the static variable could be accessed from an object, in addition to a class name. I believe that static variables reside in...
2 years ago

I need help pulling a string with spaces in it from an input file

Java
I am making a program that takes in student records from an input file and stores them in a arraylist. I am grabbing the student ID, Name, and three t...
2 years ago

Regex to match only one even decimal digit

Java
I am building on the idea of [Jonah][1]: Matching to one decimal place in Java using regex ^([1-9]\d*|0)(\.\d)?$ This regex is the one I want. But ...
2 years ago

button initialization in other function instead of OnCreate() method

Java
Can we define a function in OnCreate method which can be used to initialize buttons and all other widgets. I have tried the following but I am getting...
2 years ago

Reset session in jsp without invalidating

Java
I want to reset the session in a JSP page without invalidating it. The reason for this is, the user might have an already opened page using the sessio...
2 years ago

Maven assembly : add different version of the same artifact

Java
I create my application archive with the maven assembly plugin. All the dependency present in my pom are included without any problem. Now I need to...
2 years ago

ModelAndView object not returned to jsp

Java
I am trying to return a simple String "HelloSpring" from controller to jsp. Controller is package it.polito.ai.e4; import javax.servlet.http.HttpSer...
2 years ago

Get matching key and value in Hashmap using Java

Java
I've a map like this . Map<String , String> studentGrades = new HashMap<String, String>(); //Add Key/Value pairs studentGrades.p...
2 years ago

Aries NamespaceHandler to get Reference of Bean

Java
After successfully tried to implement my own blueprint interceptor to track method entry/exits using Namespace Handler, I'm now looking for enhancing ...
2 years ago

Scala opening write to stdout or file

Java
Let's say I have a function writeToFileOrStdout(fname: String = Nil) = { ... } If the user passes a string value for fname, then I'd like to open a...
2 years ago

AbstractMethodError: javax.ws.rs.core.UriBuilder.uri in REST, EJB Application

Java
I have troubles with my pom.xml file. I know, there is many topics about this issue, but any of them answers my problem. @Path("/actors") public cla...
2 years ago

How to get jacoco instrumentation with a play project for external functional testing?

Java
I am using IntelliJ Idea to develop a java service with APIs using the Play Framework 2.3. I have jacoco instrumentation set up for our unit tests on ...
2 years ago

Converting from CharSequence to String in Java

Java
Suppose I want to convert a CharSequence to a String in Java. Which option (1 or 2) is better and why? CharSequence source = "some text"; String som...
2 years ago

Getting empty character literal error in java code that specified unicode literals

Java
Why does this code public class Apostrophier { public static String replace(String s) { return s.replace('\u0092','\u0027'); } ...
2 years ago