Questions tagged as 'java'

1
answer

Problems in implementing JSP using Struts2

After executing the following jsp : <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEn...
asked by 19.11.2014 / 20:35
1
answer

Error 415 when posting with json

I have a CREST REST application that responded in XML, however, I want to change it and get it to respond to JSON. I can do the GET in the restclient, but the POST, PUT and DELETE do not, it gives the error 415 Unsupported Media Type. What el...
asked by 27.10.2014 / 18:00
1
answer

How to find out if the list is full?

The method below is for adding a book to a list. Returns 1 if the book already exists in the list, 0 if it does not exist in the list and can be entered and 2 would be for full list. I'm trying to test if the list is full but I do not know how....
asked by 12.12.2017 / 12:30
2
answers

Can I have performance problems joining multiple classes to a single file?

Watching many tutorials and video lessons, I always see that a java file is created for each action / class. As indicated in the image below with the arrow number 1 yellow. But as my application is getting huge, I'm starting to put the classe...
asked by 21.02.2018 / 07:04
3
answers

Why in the second example (unlike the first) does the result come out concatenated and not added?

example 1 final double BEGIN = 10.20, KM = 1.30, BAG = 2; Scanner s = new Scanner (System.in); double clientKm, clientBags; System.out.println("How many km?:"); clientKm = s.nextDouble(); System.out.println("How many bags?:"); clientBags = s...
asked by 06.11.2017 / 11:52
1
answer

Why does the IDE indicate that a code in the "if" will not be executed?

Look at the code: Why is the development IDE not considering the code in line 34, 35 and 36? Would not it have been to go into the conditional?     
asked by 14.10.2018 / 13:32
3
answers

How to convert JSON to Object and find an id (No Array) - JAVA

I have a Json that does not contain an array and I need to get some information from this Json. Follow JSON {"_status":"sucesso","_mensagem":"Impressão em processamento","_dados":{"situacao":"PROCESSANDO","protocolo":"BkVglXYWQ"}} What I'v...
asked by 21.06.2018 / 15:02
3
answers

How to import all static variables from another class?

I have two classes, A and B . The A class needs to access all existing static variables in B . How to do this import? I found a lot with get , however it does not look like this. I'm a beginner and I'm lost.     
asked by 04.07.2017 / 17:55
1
answer

Java: Get name and serial number of mobile connected to the computer

Dear, first: This is not a question of Android development. I am doing automation in java, and would like to know if there is any way to strings the device name and serial number when connecting via USB to the computer. Currently I do this by...
asked by 04.08.2016 / 19:35
1
answer

What is the most efficient way to remove an item from the ArrayList? [closed]

I would like to know which of the methods available by class ArrayList is most efficient for deleting an item from the list.     
asked by 27.05.2017 / 23:11