Posts by NilsonUehara • 3,105 points
111 posts
-
13
votes3
answers866
viewsA: What are "Magic Numbers"?
Imagine you picked up a maintenance program and see the following line: if (meuCodigo == 12) { varX = 2; } You could tell me what’s going on? Of course not, because you’d have to search the entire…
encoding-styleanswered NilsonUehara 3,105 -
0
votes1
answer187
viewsA: Sortby in JSF, brief explanation of what he does?
You mean the sortBy of Primefaces, is not? Sortby is the expression used to sort a list (Datatable) Datatable - Sort…
-
2
votes1
answer300
viewsA: Error - JSF and Primefaces
As you said, your dt_nasc attribute is of the String type and Calendar needs to be of the Date type. Either you change this or create a method to convert, for example: public Date getDtNasc(){…
-
3
votes3
answers534
viewsA: Reduce jar size in Maven Design
Check if any dependencies added to your POM.XML can be removed. Also, often a dependency depends on several other libs. If you are sure that some of them are not in use you can remove it using Ex:…
-
1
votes1
answer54
viewsA: 24x5 process in jar how to convert to . War
From what I understand, you perform a certain action from time to time, correct? I think Quartz solves your problem. It’s basically a task schedule, similar to Linux CRON. Quartz Tutorial - Caelum…
-
1
votes1
answer1629
viewsA: Automatic database synchronization in Mysql
What you want is a MASTER-MASTER data replication. You have a step-by-step link http://blog.websolute.com.br/como-configurar-replicacao-multi-master-para-mysql-no-jelastic/ The process is even…
-
2
votes2
answers523
viewsA: Compare two fields between different tables
I think you can kill everything in one query only: SELECT imoveis.id ,imoveis.vvenda FROM imoveis LEFT JOIN clientes ON clientes.cliente = imoveis.cod WHERE imoveis.cod = '1042' AND imoveis.status =…
-
2
votes1
answer400
viewsA: How to Get the Primefaces Megamenu Vertical
It seems the attribute orientation only works properly on newer versions of Primefaces. I tested with 5.3 (Community) and it didn’t work. I tested with 5.3.6 (Elite) and is ok!…
primefacesanswered NilsonUehara 3,105 -
0
votes3
answers1762
viewsA: Recover logged in user
I believe your method doLogin() be in a ManagedBean correct? Just enter your managedbean that logs in as a Property of the other managedbeans to have the user logged in. Ex: @ManagedProperty(value =…
-
0
votes1
answer345
viewsA: How to insert a text into a p:editor?
I got the answer on the Primefaces forum post PF('edt').editor.execCommand('inserthtml','texto inserido');…
primefacesanswered NilsonUehara 3,105 -
1
votes1
answer345
viewsQ: How to insert a text into a p:editor?
I have a <p:editor /> and need to insert predefined text at the current cursor position. I’ve been looking in the documentation of Primefaces and found nothing similar (I can clean using…
primefacesasked NilsonUehara 3,105 -
1
votes2
answers429
viewsA: How to change a list of another Managedbean
Include Managedbean as a Property and upgrade its collection. @ManagedBean(name = "api") @SessionScoped public class AplicacaoBean implements Serializable{ private static final long serialVersionUID…
-
1
votes1
answer630
viewsA: How to start a certain tabindex tab (primefaces)?
Use: PF('suaTabView').select(1); Ex: <p:commandButton onclick="PF('tabViewEdit').select(0);" /> Or you can activate the tab via an attribute in the Managed Bean <p:tabView…
-
1
votes2
answers816
viewsA: Create Jsonarray with objects?
I think the correct thing would be for the Itemvenda array to be inside the Sale object Venda:[{id:1, data:2015-09-28, cliente_id:1, ItemVenda:[{produto:5, quantidade:10, valorUnitario:5.00,…
javaanswered NilsonUehara 3,105 -
0
votes5
answers1153
viewsA: If the image is large vertically, height: 100%, if it is large horizontally, width: 100%?
Fix maximum width and height: <img src="suaimagem.jpg" style="max_width:123px; max-height=123px"></img>
-
6
votes2
answers1577
viewsQ: Security with Angularjs and Rest
I’m starting with Angularjs and Rest (Java JAX-RS) and I’m having a doubt. The functions responsible for Rest requests are easily viewed via the browser by right-clicking Exibir código fonte da…
-
1
votes2
answers2095
viewsA: Open numeric keypad automatically
I found! I used the plugin Cordova-android-Focus-plugin <input id="txtLeituraAtual" type="number" > JS: $scope.$on('$ionicView.enter', function(){ var…
-
2
votes2
answers2095
viewsQ: Open numeric keypad automatically
I have a page with a numeric input with autofocus: <input type="number" placeholder="Informe" ng-model='leitura.leituraatual' required="true" autofocus="true"> The problem is that the keyboard…
-
1
votes2
answers768
viewsQ: Chaining of asynchronous requests
I need to do the asynchronous processing of data series (sending data to a REST server) and, only at the end of all requests, I need to perform another function. How can I control this flow if each…
-
2
votes1
answer341
viewsQ: Mobile multiplatform development
I am a Java programmer and need to start in mobile development (Android/IOS/Windows Phone) and I would like to know what is the best way. I’ve been reading about frameworks you develop in…
-
0
votes0
answers493
viewsQ: Gitlab - I can no longer clone or pull from my repository
I have Gitlab on my Ubuntu server in production for 8 months. I can’t clone or pull from a repository (+/-400mb), but other smaller repositories work normally. I don’t even know where to start to…
-
4
votes2
answers247
viewsA: Doubts regarding the use of the Java 8 stream
You are confusing things. lista.stream().sorted() returns a new Stream (copy of lista ordered). Your "list" collection remains unchanged. However, both collections have references to the same…
-
4
votes2
answers862
viewsQ: Reading PDF with Defaultstreamedcontent. How to close it?
I have a JSF page where I Gero a PDF and need to show it on the screen. For that, I created a <p:media> It is working, but the PDF file gets stuck (never closed) and over time it ends up…
-
1
votes0
answers98
viewsQ: Tree Primefaces - node is not selected with the right button
I switched to version 5.1 of Primefaces and now when I right click to open Contextmenu node is not selected. In version 5.0 it worked correctly. <h:form> <p:tree id="plano"…
primefacesasked NilsonUehara 3,105 -
2
votes1
answer877
viewsQ: Leakage of connections with Hibernate
My system presented sporadic crashes and I ended up discovering that this happened due to processes that opened a connection but, due to some error, did not close it (Connection Leak). I solved…
-
1
votes1
answer385
viewsQ: JSF accessing serial port
I am working on a JSF system and need to send data to the serial port of the client (printer). The only way is even using Applets?
-
1
votes1
answer279
viewsA: Cluster of servers on different networks
I ended up solving my problem using the Memcached. I know it is not the best solution, since it is how to reinvent the wheel, besides being an extra layer. The case is that solved!…
-
4
votes2
answers1101
viewsQ: Remove association in relation to Many to Many
I have a relationship @manytomany unidirectional and need to remove this association according to some criteria but did not want to have to browse through all objects in the collection to remove…
-
1
votes0
answers63
viewsQ: Adding up results
I’m starting to use the framework uaiCriteria and I need a result that is a sum of records in a period. Something like (simplified): select sum(valor), sum(desconto), data, idpessoa from tabela…
-
1
votes1
answer87
viewsQ: Memcached + Tomcat authentication
I’m testing the Memcached to implement failover on my Tomcat servers. Is there any way to implement user/password security? Memcached will be on a public IP, so I find it unsafe that he’ll be…
-
1
votes1
answer281
viewsQ: JSF cluster application
What my application (JSF + Primefaces) needs to work with in a cluster? I am doing a test in a cluster 3 Tomcat environment (with session replication) and my test application does not work. At first…
-
1
votes0
answers133
viewsQ: Tomcat7 cluster does not replicate session
I have an Ubuntu with 2 Tomcat7 with the following cluster settings: The balancer is Apache MOD_JK. SERVER.XML: <Engine name="Catalina" defaultHost="localhost" jvmRoute="no0"> <Cluster…
-
7
votes1
answer279
viewsQ: Cluster of servers on different networks
I am configuring a cluster of Tomcat8 servers. The servers are already doing load balancing (mod_jk), but I need to implement high availability (session replication). In the documentation I have,…
-
1
votes2
answers1483
viewsQ: persistence.xml for development and other for production?
I have my persistence.xml configured for a local database. <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/meubanco"/> <property…
-
0
votes2
answers2691
viewsA: Display an image that is outside the JSF project
You can create a Streamedcontent to traffic your photo. <p:graphicImage value="#{fotoMB.foto}" cache="disable"/> public StreamedContent getFoto(){ File foto=new File("suafoto.jpg");…
-
4
votes1
answer3814
viewsA: Netbeans Messing Up Accent
According to the @gabrielhof tip, I added the parameter -J-Dfile.encoding=UTF-8 in the option netbeans_default_options of the Netbeans configuration file $DIRETORIO_NETBEANS/etc/netbeans.conf…
netbeansanswered NilsonUehara 3,105 -
3
votes1
answer3814
viewsQ: Netbeans Messing Up Accent
For a few days now, I’ve noticed that Netbeans is changing accented characters in my code. Apparently, it only does this in the class that was opened when I closed Netbeans. That is, I am editing…
netbeansasked NilsonUehara 3,105 -
0
votes1
answer99
viewsQ: Change of entity reflect on related entities
I have two entities, for example: Note: Fictional code to facilitate understanding of the problem. @Entity public class Celular{ @Id @GeneratedValue(strategy= GenerationType.IDENTITY) private int…
-
1
votes4
answers2527
viewsA: How to take the edge of a primefaces datagrid?
Try to remove the edge of the ui-datagrid and of ui-datagrid-content <style> .ui-datagrid{border: none !important;} .ui-datagrid-content {border: none !important;} </style>…
-
2
votes1
answer560
viewsA: Write TXT formatted via VB6
The problem is not in your program that generates the text file (VB6) but in the file view, because if the program used (e.g., notepad) is using a variable spacing source (e.g., Arial) the content…
-
2
votes1
answer5030
viewsA: Java check, show values recorded in Mysql database
This site has everything you will need to work with JDBC Caelum - Databases and JDBC Example: // pega a conexão e o Statement Connection con =…
-
4
votes2
answers725
viewsA: Organization of projects in packages
By the way you are doing everything in text editor, IE, you are not using an IDE. You need to specify the package to compile: C:\Users\Leandro\Documents\Java\Exercícios\testes>javac…
-
0
votes3
answers1169
viewsA: How to load the list of items from p:selectOneMenu when clicking to open the dropdown?
What if you include a Poll? From time to time you update your select... <p:poll interval="3" listener="#{counterView.increment}" update="txt_count" />
-
4
votes1
answer2195
viewsA: How to sort and disarray a JSF datatable by clicking on the column?
If you are using or can use Primefaces, just include the "sortBy" property in your column <p:dataTable value="#{testeMB.objetos}" var="o"> <p:column headerText="Nome" sortBy="#{o.nome}">…
-
6
votes1
answer5016
viewsQ: Include jar file in Maven project
How do I include a . loose jar in a Maven project? Obs: The jar I need to include has dependency on another 3 jar files. The jars in question are from the project Brunette Attempt #1 I created a lib…
-
0
votes2
answers1259
viewsA: How to search within an SVN repository for a change in a file type?
I use the Tortoisesvn that makes these searches much easier... Just right-click the folder containing your . js and select Tortoisesvn > Show Log and filter through the revision range. It will…
svnanswered NilsonUehara 3,105 -
3
votes2
answers814
viewsA: How do you tell Maven that one module depends on another?
Cyclical dependency? This is project failure, because how will you compile project A if it depends on project B and vice versa? The correct thing in this case is to separate the common features in a…
mavenanswered NilsonUehara 3,105 -
2
votes2
answers939
viewsA: How is the java project separation?
You can separate your project into modules. In this post Eder Magalhães shows how to do this using Maven. http://www.yaw.com.br/screencast/show/maven-multi-module/…
javaanswered NilsonUehara 3,105 -
1
votes1
answer119
viewsA: Session expiring on IE
It seems that the problem was in the login form, where the LOGIN button was a p:commandButton, being the default behavior of this component AJAX=TRUE! Replace it with a <input type="button">…
-
0
votes1
answer119
viewsQ: Session expiring on IE
I have a JSF2 system where I use JAAS for access control. Everything is working fine in Chrome, but, for a change, IE occurs a problem. Basically I have a form with login and password fields:…