Questions tagged as 'java'

1
answer

How to access a specific header from an http response?

I have a Rest API in Java, which makes use of JWT to authenticate users and generate tokens to access their resources. I have an application in AngularJS, which should consume these resources, but I must first request a token in the API. I would...
asked by 26.08.2017 / 14:01
1
answer

What is Beacon?

What is Beacon? How can I deploy using Android? Can be implemented in .NET or just in Java? Do you have a simple example?     
asked by 07.08.2017 / 16:42
1
answer

Temporary variable performance within loop

During college a teacher commented to me that declaring a variable before a loop and reusing it was an economical and more interesting way to do it. For example (in Java): String str; for(Pessoa p : pessoas){ str = p.getNome();...
asked by 13.06.2017 / 22:21
1
answer

Convert to String number with scientific format

I have the following number in scientific notation: 7.89894691515E12 I need to convert it to String in the common format: 7898946915150 How to do this through Java?     
asked by 19.08.2014 / 21:38
1
answer

How to make a multilingual website and identify the country of origin?

I am developing a website in JavaEE and would like it to be multilingual (at least English, Portuguese and Spanish). But I would like to know how large websites, such as Facebook, for example, do to identify the country of origin and offer the s...
asked by 31.08.2014 / 06:38
1
answer

Optimized approach to check if a certain entry exists in the Windows hosts file

I have a Java web application with Applets that access web services. These services are accessed through a specific hostname (example: services.webapp.com.br ) configured in the application. Knowing that it is the user's JVM that will exec...
asked by 04.08.2014 / 23:29
1
answer

Gson to Java - Map

I need to pass these values from a json file to a java class, the Json file is of this type: { "id":1, "name":"Gold", "description":"Shiny!", "spriteId":1, "consumable":true, "effectsId":[1]...
asked by 23.10.2015 / 03:00
1
answer

How / When to Close Hibernate Session?

I have an error after closing Hibernate Session public String listarTodosClientes() { session.getTransaction().begin(); List<Cliente> lista = session.createCriteria(Cliente.class).list(); session.close(); return lista.toS...
asked by 13.11.2014 / 13:36
2
answers

Object type for data of type Time (Ex: 1 min and 56 seconds) in Android / Java?

I need to work with times, such as a timer (not my case), which at the end of its execution would have to save its value. So I thought of some possibilities like: java.utils.Date : only the data in the case is not a Data; In l...
asked by 13.11.2014 / 13:57
1
answer

Java using .DLL library

I'm having trouble creating the interface in java, because I can not figure out the header of the function in C. Example Header C function: CMOEP_API char * CALLCONV CMP_GetLastError( ); Now in java I have this but I do not know how to i...
asked by 22.09.2014 / 17:07