Questions tagged as 'java'

1
answer

Add CORS to SOAP service with Ionic

is to make a query. I have a SOAP service to which I need to implement CORS to later consume this service from a mobile app on Ionic, but I do not know where to start or how to do it correctly. I know that the implementation of these in my Servi...
asked by 07.11.2018 / 22:06
1
answer

Hibernate, exception when doing update

I have an exception when calling an update () method of the UserService class, with the aim of updating a user's data stored in the db. UserService class: import java.util.List; import db.hibernate.dao.UserDao; import models.User; publi...
asked by 07.11.2018 / 22:32
1
answer

How to create classes for object / relational mapping?

I am new to hibernate and jpa, I have to create 3 classes User, Client and Attribute that will be mapped to tables, the classes have the following properties: User has: id, name, surname, password, many clients, many Attributes. Clien...
asked by 07.11.2018 / 13:29
1
answer

How to load dynamically a modal with Spring MVC and ThymeLeaf

In the image I have two rows that each represent an object of type FisicHost in my program. Clicking on any of the two rows opens a modal with the credentials of the relevant FisicHost. The problem is that indistinctly FisicHos...
asked by 07.11.2018 / 14:27
2
answers

Extract data from an EditText and add them to object

I have the following code: ArrayList<Lista_entrada> llibres = new ArrayList<Lista_entrada>(); // Afegim uns llibres d'exemple. llibres.add(new Lista_entrada( "BUHO", "Búho es el nombre común d.")); llibres.add(ne...
asked by 17.10.2018 / 14:44
1
answer

java.lang.ClassCastException: java.lang.String can not be cast to entities.User

I'm using the ViewPreparer class to prepare my modules, but I'm getting this error: java.lang.ClassCastException: java.lang.String cannot be cast to entities.Usuario The complete trace of the error is as follows: java.lang.ClassCastExcept...
asked by 06.10.2018 / 17:33
1
answer

class Scanner problems

Scanner lector = new Scanner(System.in); int numerosIngresados; int numeroMayor = 0; int numeroDiez = 0; int sumaImpares = 0; int contadorImpares = 0; int contadorNumeros = 0; for(int i...
asked by 06.10.2018 / 04:18
2
answers

(Fixed) fix in java when entering 2 words in the same array address

In class we are seeing arrangements in java and they ask me for a program that: Ask how many names you want to enter. Print them. something like this: [0] = "Alejandro Sanchez"; [1] = "Fernando Ortega"; The only thing I could d...
asked by 05.10.2018 / 03:51
1
answer

Error traversing ArrayList java

private ArrayList GetIC (){ ArrayList<Sorpresa> molde; molde = new ArrayList <>(); for (Sorpresa t : juego.getMazo()){ if (t.GetTipo() == TipoSorpresa.IRACASILLA){ molde.add(new Sorpresa(t.GetTexto...
asked by 22.09.2018 / 15:15
1
answer

pass a JsonArray to an ArryList

I have the following code: import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.Iterator; import org.json.JSONArray; import org.json.JSONObject; public class...
asked by 05.10.2018 / 22:40