2018-10-22         Vivien

Flutter Gradle build failed with an exception

In my company behind our proxy i can't start a flutter project. I don't get gradle running.I set this config into gradle.properties:systemProp.http.proxyHost=http://my.company.comsystemProp.http.proxyPort=8080systemProp.http.nonProxyHosts=127.0.0.1|localhostsystemProp.https.proxyHost=http://my.company.comsystemProp.https.proxyPort=8080systemProp.https.nonProxyHosts=127.0.0.1|localhostSSL encrypted traffic will be decrypted. We have self signed certificates on our proxy server. I don't find any way to tell gradle the path to my certs.pem file.The stacktraceLaunching lib\main...

 java                     2 answers                     85 view
 2018-10-22         Alan

spring boot (webflux) rest controller get remote IP address

Using spring boot for simple REST application.<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --></parent><dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dependency> <dependency> <groupId>org.springframew...

 java                     2 answers                     56 view
 2018-10-22         Baron

What happens when an item is deleted from a list initialized by hashmap.values()?

I have the following declaration in class A:Map<String, MyClass> myMap = Collections.synchronizedMap(new LinkedHashMap<String, MyClass>());Class A also has this function:public List<MyClass> getMapValuesAsList() { return new ArrayList<>(myMap.values());}In class B, I have a List initialized like this:List<MyClass> myList = cart.getMapValuesAsList();What I assume is that myList keeps references to the values of myMap. When I call a setter function in an item in myList, the related value is also updated in myMap, supporting my assumption. Howe...

 java                     1 answers                     4 view
 2018-10-22         Jessie

Java Child Object run Parent Object s method

I decided using BorderLayout for swing design named Loginwards. And I wrote 5 Classes for 5 side of BorderLayout as PageStart, LineStart, Center, LineEnd, PageEnd.I have undecorated Loginwards and designed PageStart for use minimize,resize,quit.(for my own images, rules...) button quit is simple because it have worked like this button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { System.exit(0); } });but for example minimize I could not solve. I should have changed my Loginwards properties ...

 java                     1 answers                     12 view
 2018-10-22         Booth

Overload Constructor with Class in Parameter

Was giving the first code below. What is the proper way to create the Turtle Class? -- Basically, I am trying to get this to show no error: Turtle t = new Turtle(STARTX, STARTY, w);I think my problem might be here with the overload constructor: public Turtle (double STARTX, double STARTY, Class w )import java.awt.*; //import color;public class PA1{ //These are constant values that you can use private static final int STARTX = 100; private static final int STARTY = 100; private static final int CHAR_WIDTH = 100; private static final int CHAR_HEIGHT = 100; private...

 java                     3 answers                     19 view
 2018-10-22         Regan

How to stop server in Client Server multithreading

I am implementing a multi-threaded client-server application in java. I want to implement JDBC in this program and I want my server to retrieve data from the database whenever it is started. I will store that data in my collection instances, perform manipulations on data and when server completes execution, I need to store the data back to the database. The problem is that the server is in an infinite loop waiting for clients and I am not able to figure out how to make the server stop.This is my server program:import java.io.*;import java.text.*;import java.util.*;import ja...

 java                     2 answers                     52 view
 2018-10-22         Chester

How do I inject build version into pom.xml using TFS on UI?

I have a TFS build definition that deals with a java spring backend application that is built with Maven. I have a build step called "Maven pom.xml" where I obviously can set some options of the pom.xml. I need to change the "version" tag in the pom.xml using TFS whilst building, so that the "info" endpoint in actuator serves the correct version number including the TFS build number.1) Is this possible using the TFS UI at all? 2) If yes, should I change "Options" textbox content or "MAVEN_OPTS" and how do I feed parameters there, that change <version> in the pom.xml? ...

 java                     2 answers                     59 view
 2018-10-22         Jean

How to inject the username (not the Authentication)?

In my spring boot application, in my rest controllers, I successfully inject an instance of Authentication to get the session's user information.However, in all of those controllers, I currently call a helper method like this:@GetMappingpublic List<String> getData(Authentication auth) { String username = auth.getName().replaceFirst(".*?\\\\", ""); // to remove windows domain name // the rest of these methods only use variable `username`, never `auth`}How can I reduce this code duplication? You can create a utility class as follows and then you can use it like...

 java                     1 answers                     66 view
 2018-10-22         Yvette

Use jdeps for module which has multi-version implementation, but root module doesn't

Not quite sure how to use jdeps to inspect module if current module has multi-version dependencies. jdeps keep asking me provide --multi-version 9 but other dependent modules is not multi-version.How to properly use jdeps for such cases?command:jdeps -cp .\..\..\..\modules --module-path .\..\..\..\modules -s ws-gen.jarError: jaxb-api.jar is a multi-release jar file but --multi-release option is not setcommand:jdeps --multi-release 9 --module-path . -filter:package -s jaxb-api.jarError: bcprov-jdk15on-1.60.jar is not a multi-release jar file but --multi-release option is s...

 java                     1 answers                     69 view
 2018-10-22         Clement

Scrolling in ListView loses text color and typeface

I'm not sure why it's not working, but what my code should do is very simple.I have a ListView with default text color (BLACK) and typeface (MONOSPACE) that I declared in getView(), so everything works well when the view is created.When I select an item from the list it should change the text color to RED and the typeface to MONOSPACE and BOLD, and if I click another item, it will change that item to RED and BOLD and return the previous text to BLACK and NORMAL. This works just fine, but if I scroll away from the RED and BOLD text until it's not visible, and then scroll bac...

 java                     1 answers                     94 view
 2018-10-22         Alberta

Selenium JAVA : How to validate a frequently changing data in the front end?

The website that I am automating has a data which is something like, "Delivery Sep 06 Thursday" The date keeps changing everyday. I now have to validate it's presence and the message format. Any help on this is appreciated. You have 2 options:If you know what's a formula behind expected date (for example: always same day; always 3 days from now, or even some more complicated rules), then your test can generate expected date much like the site does, and validate that date displayed on the site is the same as your expected date. If you don't know the formula, it's too comp...

 java                     2 answers                     20 view
 2018-10-22         Christian

Regex: how to substitute a string with n occurrences of a substring

As a premise, I have an HTML text, with some <ol> elements. These have a start attribute, but the framework I'm using is not capable to interpret them during a PDF conversion. So, the trick I am trying to apply is to add a number of invisible <li> elements at the beginning.As an example, suppose this input text:<ol start="3"> <li>Element 1</li> <li>Element 2</li> <li>Element 3</li></ol>I want to produce this result:<ol> <li style="visibility:hidden"></li> <li style="visibility:hidden"...

 java                     5 answers                     21 view
 2018-10-22         Sid

SpringMVC built by IDEA: No converter found for return value of type

I use IDEA to build a simple RESTful server based on SpringMVC. But @RestController and @ResponseBody can't convert POJO to JSON by jackson JSON.In dispatcher-servlet.xml:<mvc:annotation-driven/>In pom.xml: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.9.5</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> ...

 java                     2 answers                     22 view
 2018-10-22         Dawn

How do I close the download pop in chrome browser when downloading PDF

I am using java selenium to automate my application.I am downloading PDF and parsing.There are multiple test cases with PDF in my application. So once i download first PDF the chrome show a pop at the bottom of browser that file is downloaded with file name so next time when i try to download the second PDF the Download button is below this pop and not able to click on download option.Used isDisplayed method to check status which return false and isEnabled returns true.Tried execution of the PDF testcase in another window it is not working either. Please refer the image for...

 java                     2 answers                     23 view
 2018-10-22         Leo

Post incrementing operator and array assignment

Here is the code below:public class Country{ private String name; private City [] cities; private int index =0; public Country (String n, int nrc){ // nrc as in number of cities name = n; cities = new City[nrc]; } public boolean exists (City str){ for(int i =0; i>index;i++){ if(cities[i].equals(str)){ return true; } } return false; } public void addCity (City str){ if(str == null){ System.out.print("City not initialized!"); } if(exists(str)){ ...

 java                     5 answers                     25 view
 2018-10-22         Cathy

why this link works even after logout(or invalidate session)?

I have generated dynamic delete link for each row in a table in jsp. When I click on that link It should delete the associated row,It works Fine. But it should not delete the row once I logged out..I copied the delete link and logged out..Now If I run that link It redirects me to Login page, If I login again viewed the students in a table..It deletes that particular row.Why this even after removed the attribute and invalidate the session It still able to reach the servlet?generated link for delete student..http://localhost:8080/feeManagement/Delete_Action_Student?delete=676...

 java                     1 answers                     70 view

Page 1 of 9889  |  Show More Pages:  Top Prev Next Last