Questions tagged as 'java'

3
answers

DecimalFormat does not show me 0 in decimals

I have this: public String refrescarPrecio(double cantidad) { DecimalFormat df = (DecimalFormat)NumberFormat.getInstance(); df.applyPattern("$ ###,###.##"); String str = ""; str = df.format(cantidad); return str; } If...
asked by 16.11.2016 / 01:46
1
answer

Equivalent to DESCryptoServiceProvider in Java [closed]

In C # I use the following object: DESCryptoServiceProvider dESCryptoServiceProvider = new DESCryptoServiceProvider(); Is there an equivalent in Java?     
asked by 01.06.2016 / 18:26
1
answer

Migrate Android to Phonegap [closed]

Boys, I have a question that I hope you will help me resolve. The question is that if you can migrate an Android Studio application to PhoneGap? I await your answers, greetings.     
asked by 26.05.2016 / 09:44
1
answer

Realm Error io.realm.exceptions.RealmMigrationNeededException on Android

I am starting to use database style Realm after adding a new field Age to class Person import io.realm.RealmObject; import io.realm.annotations.Index; import io.realm.annotations.PrimaryKey; public class Person extends RealmOb...
asked by 01.06.2016 / 07:23
1
answer

It is possible to use a @Resource defined in the same class @Configuration

I have something like this: The class Other needs an instance of MyBean so create the attribute and use it when I create the bean Other @Configuration public SomeClass { @Resource private MyBean b; @A...
asked by 19.02.2016 / 23:16
1
answer

How to change Action according to condition in Ajax url?

I have the following sript: $('a[id^=asociar-]').click(function (e) { e.preventDefault(); var params = { id: parseInt($(this).attr('id').substring(8)), proveedorId: $('#proveedorId').val() };...
asked by 07.05.2016 / 02:22
1
answer

Assign values to a multidimensional array using a for loop

Good, I'm making a game board (a simple sink the fleet), and to define the boxes I'm using a multidimensional array (x, y). The idea is to initially assign values to these boxes depending on the content (toilet = 0 boat = 1), it seems too gross...
asked by 18.04.2016 / 14:32
1
answer

Threads - output desynchronized

What is the difference between the first and second codes? Why, seeing the first one, the outputs come out messy or repeated and in the second they turn out well? In the first, the syncronized method is that of 'Person', and having the same inst...
asked by 07.05.2016 / 14:04
3
answers

pass data to a jsp from a java class

How can I pass data from a query to a jsp? Let me explain: I have a jsp page from which I get parameters, I pass them to a servlet, this in turn executes a query class that goes to the bd, but I do not know how to pass the result of that quer...
asked by 01.08.2016 / 01:31
1
answer

Mapping Mybatis with an Interface instead of an xml file

I'm working with mybatis, this is my configuration and it's working: mybatis-config.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/myb...
asked by 25.01.2016 / 20:58