Posts by utluiz • 72,075 points
957 posts
-
3
votes1
answer724
viewsA: Timetask scheduling Java Tasks
To execute the Timer once per day, the third parameter of the method of the method shall be the value in milliseconds for a day. The method you are using gets three parameters: The task to be…
-
1
votes1
answer1184
viewsA: Error in XSD validation
How does the <any> The problem in this case is that the tag <any> is being used incorrectly. In XSD it is clear that the tag could be anything, as long as it maintains the structure of…
-
0
votes2
answers537
viewsA: Automatic e-mail picking up data from Oracle database
There are many ways to do this, many even. One that I consider quite usual in the market is to use the Quartz Scheduler, a task scheduler that supports distributed environments (cluster) and can be…
-
63
votes1
answer46121
viewsA: What is a DTO?
Data Transfer Object (DTO) or simply Transfer Object is a widely used design standard in Java for transporting data between different components of a system, different instances or processes of a…
-
3
votes2
answers292
viewsA: Leader and Java Recursion Led Logic
There are different techniques for modeling a hierarchical structure in a relational database, as can be seen in the question: How to model a tree data structure using a relational database? The…
-
3
votes1
answer115
viewsA: Binding on Spring MVC not working
Spring MVC won’t do the Binding from a field to a set. However, if the idea is to receive a comma-separated mailing list, just to quote an example, a simple solution would be to create a Setter who…
-
1
votes1
answer174
viewsA: google plugin problems in eclipse Luna
It seems that the plugin WTP (Web Tools Platform) in your Eclipse. If you downloaded the simplest and "raw" version that is available on the site, you will not have it at all. Download the Eclipse…
-
3
votes2
answers691
viewsA: How to index an iframe in Google?
When the "Google" (actually the "robo" indexer or crowler) reads the page it also especially looks at some HTML elements that have some kind of link, then following these links and indexing them in…
-
2
votes2
answers856
viewsA: @Predestroy on @Viewscoped
1 - It is problematic that the bean will never be destroyed and will always be created every time the page is accessed? Things like this are the reason I don’t recommend JSF for any new project.…
-
1
votes1
answer2969
viewsA: Access application on a virtual machine with Tomcat server
This is a great way to perform compatibility tests. I’ve done this many times. In this case, the problem may be in two points: Network card configuration in Virtualbox I advise you to stay in gear…
-
2
votes2
answers73
viewsA: Error in Python language
First, use == to compare variables and not =, which is attribution. Second, on the else later, turn it into a elif or add a : (two points) and remove conditions. Third, beware of the Eclipse…
-
2
votes1
answer283
viewsA: Java JNLP Application and Database
What is JNLP JNLP (Java Network Launch Protocol) is only a form of distribution of a Java desktop program facilitated by a class loading engine remotely. In short: it’s like a shortcut that…
-
26
votes7
answers21565
viewsA: Why is the use of frames and iframes considered bad practice?
When the frames "glowed" Frames were often used on static pages where it is not possible to do include on the server. For example, on a pure HTML site, header, footer and menu should be repeated on…
-
1
votes1
answer803
viewsA: Junit with spring Autowired
There’s no real mistake This behavior is completely natural and expected. Reason: an HTTP request (or the class that encapsulates such a request) will only actually exist in the web environment…
-
17
votes2
answers1064
viewsA: When to use Graceful Degradation and when to use Progressive Enhancement?
Technically there is no difference With both approaches it is possible to implement compatibility with any browser, in any version. The difference between them is like an approach top-down or…
-
2
votes3
answers2485
viewsA: How to insert res/string string in the String[]{} array;
Just to leave a correct reference on Arrays in Java (which does not fit in a comment), documentation sets the following boot modes: Empty array with new int[] anArray = new int[10]; anArray[0] =…
-
8
votes3
answers403
viewsA: Agile development and documentation update
The point is... When your team meets or you discuss some functionality with a fellow developer, you use the diagrams? In case affirmative, then the use must be everyday, therefore is rewarding the…
-
35
votes3
answers1083
viewsA: To what extent is premature optimization a problem?
An analogy When a teacher requires his students to do a certain task, what is one of the most important questions to be asked? "What is the delivery time?" The delivery can be immediate, for the…
-
3
votes1
answer1739
viewsA: How to perform tests on private methods using Mockito
Apparently not possible with Mockito, but there is Powermock, a framework that extends other frameworks like Mockito, and allows test private methods. However, in general, if a private method has…
-
0
votes2
answers73
viewsA: Why does this jquery example of w3s not work within web-inf?
The briefcase WEB-INF is protected by containing the settings, classes and libraries of a Java application. It is not allowed to access any resource from this directory via URL for security reasons.…
-
9
votes2
answers477
views -
4
votes2
answers103
viewsA: Why @ disappears by clicking on the link
URL parameters must be encoded so that the special characters do not interfere with the way the URL is interpreted. In the case of PHP, it would be necessary to use a function such as urlencode in…
-
5
votes3
answers727
viewsA: Does complex code interfere with application performance?
Complexity Contrary to what one might think at first, a good program will usually be less complex than a bad program. Many people think that the best programmer is the one who writes the most…
-
0
votes2
answers895
viewsA: Manipulating a List inside a foreach in a view
Create a method getDestinationSize in your class Category that returns the size of the attribute destination. Then in your JSP, just access the method ${c.destinationSize}.…
-
2
votes2
answers168
viewsA: Pass username to Rigger de historico
The user’s definition should be in charge of the application itself, since it is it who controls the actions in the database. Unless the database had registered each user and the connection used the…
spring-mvcanswered utluiz 72,075 -
0
votes2
answers75
views -
3
votes1
answer3217
viewsA: How to prevent a simple query from traversing the entire Mysql database
All this depends a lot on how the environment is configured, the modeling of the database and the query performed and the way. Ambience If database and its language run on the same machine a severe…
-
6
votes3
answers2562
viewsA: Sort SQL by 1,2,3 instead of 1,10,2,3
If the field format always follows the same pattern, you can capture the part before the dash and convert to a number, then sort the result by this value. Example: select *, CONVERT(INT, LEFT(nome,…
-
2
votes1
answer358
views -
2
votes2
answers64
viewsA: How to iterate over a huge amount of records with scala sorm
According to a comment on the documentation, the fetch of the entities is done in two stages: The query with all filters and sorts is executed in the database, but recovering only the id (primary…
-
1
votes2
answers87
views -
2
votes1
answer755
viewsA: Improved Hibernate Performance
Clayton, you’re missing some concepts about how hibernate works. There are actually several sources that teach differently and I understand that this makes it very confusing for those who are…
-
3
votes1
answer1993
viewsA: Dynamic fields with jsf and ajax not rendering mask
When events occur in JSF, this renders part of the view through Ajax, replacing the components of the HTML code with new ones. Often this is imperceptible, but each updated element is a new element…
-
0
votes1
answer1097
viewsA: Hibernate: Error while trying to persist field that maps foreign key
The problem is caused because the instances used in relationships are not JPA entities. The objects are already outside the EntityManager. When you select an item from Produto or pagina, they have…
-
15
votes2
answers1081
viewsA: What are the advantages and disadvantages of Duck Typing?
As a Java developer, I am not the #1 fan of this technique. : b But I can see some of the impacts Duck Typing may have. Perks Flexibility: facilitates refactoring, since it is not necessary to…
encoding-styleanswered utluiz 72,075 -
1
votes1
answer125
viewsA: Register load test does not persist in the database
Check other tables It is possible that the functionality in question will record data in another (s) table(s) and there will be some record. The system, seeing that something already exists, does…
-
3
votes1
answer721
views -
16
votes2
answers6730
viewsA: How does the hash table implementation work?
Each thing is one thing First of all, it is important to understand that each type of data structure has a more specific application. So, say that hashes are faster than chained lists is to compare…
-
4
votes2
answers909
viewsA: Convert List<T> to T... dynamically in a method call
I have prepared a functional example of how the method with varied arguments should be called. The main idea is you should pass an array of parameters to the invoke, only that the arguments of…
-
1
votes1
answer1931
viewsA: Aligns in the same row rowEdit and other buttons in Primefaces
First, force so there is no line break in the cell in question and set a fixed width. Example of styles inline: <p:column headerText="Ação" style="width: 200px; white-space: nowrap;"> The…
-
1
votes2
answers2488
viewsA: Test coverage using Sonar
I didn’t get to do that, but according to sonar documentation you can configure a multi-module project and include multiple projects through certain file settings sonar-project.properties. For…
-
3
votes1
answer338
viewsA: What is the design pattern to use to save objects that have similar ways to save?
I don’t know a design pattern to do this directly. However, there are several techniques to achieve this goal. Aspect-Oriented Programming (AOP) The Spring Data JPA project, cited by…
-
24
votes3
answers8116
viewsA: How does the session work in web browsers?
What is the session In web projects, a session is the use of an application by a user, usually comprising a sequence of requests. On the other hand, the term session may also refer to the content,…
-
9
votes3
answers2517
views -
5
votes1
answer1169
viewsA: Selectonemenu of Primefaces selects an item by pressing a hot key with CTRL
I bypassed the problem by recovering a later version of the Primefaces library from the SVN repository. Some Javascript functions were fixed. I extracted the fixed functions and added a Javascript…
-
1
votes1
answer174
viewsA: Formal specifications, when to use? Do we have any actual standards?
I have always worked in companies in the financial sector, although the nature of the systems varies greatly. In my practical experience, I find it almost impossible to define a general…
software-engineeringanswered utluiz 72,075 -
1
votes1
answer1791
viewsA: Using JPA with H2 Database
To command grammar SELECT H2 does not have the database. You can only have the table name, prefixed or not with the schema. The examples of Quickstart corroborate this. Think that the base is…
-
2
votes1
answer248
viewsA: Floodfill with primefaces. Catch coordinate of click on p:graphicImage
The great @Balusc posted a solution for this, but not specific to Primefaces. I will transcribe the relevant part below... The best way to do this is to place hidden fields with their coordinates,…
-
9
votes1
answer1752
viewsA: Vectors and Angles (Molecular Geometry)
I played a little with Analytical Geometry to come up with an answer. I found a solution that can be summarized in the following steps: Calculate an orthogonal vector to the two vectors and…
-
39
votes4
answers3366
viewsA: Are getters and setters an illusion of encapsulation?
I agree with all the answers. Getters and setters are essential. But the point is, they are at all times necessary? What really needs to be accessed? It happens that it is common practice to create…