Posts by hlucasfranca • 429 points
14 posts
-
2
votes2
answers4675
viewsA: Exception Treatment REST Spring Services
As the handling of errors as well as others such as Logging, data access, etc... are called cross interests(cross Cutting Concerns), the most appropriate would be to treat the exceptions shot by…
-
3
votes1
answer2523
viewsA: Jsonformat changing date on a get request
However, even defining the locale for the Brazilian zone, which would be UTC-03 Actually, the locale has another meaning. Try changing the annotation to define the Timezone: @JsonFormat(shape =…
-
3
votes2
answers207
viewsA: Problem with String Comparison Denial
The part with problem is this same: while ((!opcaoSentar.equals("J")) || (!opcaoSentar.equals("C"))); Change to: while ((!opcaoSentar.equals("J")) && (!opcaoSentar.equals("C"))); Because…
-
1
votes1
answer1094
viewsA: How do I login to Spring Security, JSF 2.2, and Managedbean?
I had to implement this solution a while ago, based on this link: http://www.programming-free.com/2016/01/spring-security-spring-data-jpa.html You need to configure Authenticationmanagerbuilder, ex:…
-
1
votes1
answer244
viewsA: Receive multiple inputs in html tag with Angular 2
If the component is a component you are creating, you can add more inputs to be able to receive the desired parameters by using the @Input: @Component({ templateUrl: './seu-template.html',…
-
3
votes2
answers2905
viewsA: Jtextfield null field validation
To facilitate validation, if more fields are included or if you have to validate other screens, you can use a utility method by passing the JTextField desired: protected boolean estaVazio(JTextField…
-
0
votes1
answer36
viewsA: My button does not work when I put f:validateRegex
Your inputs are with the id duplicate: <h:inputSecret id="passwordInput"> Abcs!
-
0
votes2
answers604
viewsA: Disable a p:inputText by focusing the cursor on another p:inputText
Alessanda, The estate disabled is actually part of p:inputText. Another thing: the immediate is it necessary? If not, remove it. Just put the handleKeyEvent for the event of keyup of inputText. So…
-
1
votes1
answer138
viewsA: Numberformatexception in GUI
Daniel, to treat values instead of using R$ hardcode, you can use the class NumberFormat, using a utility method such as: // Adicione esses atributos à sua classe private Locale localeBrasil = new…
-
1
votes2
answers954
viewsA: Compound interest with switch and [preferably] no break in each case
It would be easier to create a method to calculate the interest, follows example code: public class TesteJuros { public static void main(String[] args) { for (int i = 0; i < 12; i++) {…
-
-1
votes1
answer685
viewsA: How to read browser logs?
You can overwrite the function, but have to overwrite again if the page is updated: <script> /* coloque aqui a funcionalidade que deseja */ console.log = function(arg){ alert(arg); };…
javascriptanswered hlucasfranca 429 -
1
votes1
answer577
viewsA: Java - Swing - Timeunit.Leep time counter
You can use a Swing Timer for this: import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JLabel; import…
-
2
votes2
answers360
viewsA: How to validate in HTML forms
Use the required attribute: <input type="text" name="obrigatorio" required> Abcs!
-
3
votes1
answer162
viewsA: Thread of a "flashing" dot
To use double buffer in Swing, you can make your class inherit from Jpanel, and then override the paintComponent method. After that just insert your class into a Jframe: import java.awt.Color;…