Posts by Henrique Santiago • 851 points
54 posts
-
1
votes1
answer148
viewsA: PKCS11 Wildfly 13 - Digital certificate
Some JRE classes are not loaded by default by Wildfly. Some of them are required by the API to load the digital certificate programmatically. It is necessary, then, to force the upload of them by…
-
1
votes1
answer148
viewsQ: PKCS11 Wildfly 13 - Digital certificate
I’m trying to use the following library: https://github.com/Samuel-Oliveira To use it, it is necessary to upload a digital certificate, in the case of type A1. When trying to use it with a normal…
-
2
votes0
answers35
viewsQ: CDI bean that goes up with the application
Is there any way to start a CDI bean next to the application I have the following bean: @ApplicationScoped @Named public class MyBean implements Serializable { @Inject private Helper helper;…
-
1
votes2
answers1839
viewsA: java.lang.Numberformatexception: For input string: "code"
The error happens by the fact of the attribute rowKey of the component p:dataTable for String type and you are passing a Integer(id). What you can do is create a method that returns this attribute…
-
1
votes0
answers22
viewsQ: Jaas does not work with tomcat7 Maven plugin
I’m using the JAAS for the safety of my webapp. I declare only one JDBCRealm of the normal Tomcat, passing the bank credentials... follows the context.xml with the Declaration of the Realm: xml…
-
0
votes1
answer228
viewsA: CDI is not working with Tomcat7 by Maven + JSF
Just move the file beans.xml to the folder src/main/resources/META-INF
-
1
votes2
answers1186
viewsA: Extract JDBC Connection from Entitymanager using JTA
The way I did it was this: Session hibernateSession = this.entityManager.unwrap(Session.class); return ((SessionImpl) hibernateSession).connection();
-
0
votes1
answer41
viewsQ: '_$visited' property in Javascript object at the return of Obervable’s map() function
I have a Webservice implemented with JAX-RS and I’m consuming it with a service(utilizando Angular 2) Follow the service: @Injectable() export class ModeloService { constructor(private http: Http) {…
-
0
votes2
answers132
viewsA: Cast Typescript ( ERROR Typeerror )
I decided to solve the problem by creating an unstable Model object, taking advantage of object orientation. The way I put it in the post: model.service.ts getAll(): Observable<Modelo[]> {…
-
0
votes2
answers132
viewsQ: Cast Typescript ( ERROR Typeerror )
The problem is this, through a service(ModeloService), receive an array of Modelo, where Modelo is a class, it turns out I’m not getting access to the methods of this class, because the cast in the…
-
2
votes2
answers1186
viewsQ: Extract JDBC Connection from Entitymanager using JTA
In an environment Javaee, there is the possibility to extract the JDBC connection(java.sql.Connection) using JTA? I have a datasource in Wildfly, where I inject in the following way:…
-
0
votes4
answers327
viewsA: Doubt about how to generate random numbers
Create an array for these numbers and do the method gerandoNumeroSorteio return this array. The method has been modified to create an array and be populated always testing(with the method…
javaanswered Henrique Santiago 851 -
1
votes0
answers407
viewsQ: Wildfly loading very slow, VERY SLOW
I was studying JavaEE7 and using the Widlfly 11.0.0.CR1, first without any configuration on the server itself, just running a normal webapp, without many things, a form, with a listing, and the time…
-
0
votes1
answer228
viewsQ: CDI is not working with Tomcat7 by Maven + JSF
I’m not able to make CDI work, I’m using the tomcat7 plugin from Maven. Beans.xml is created and in the WEB-INF folder, context.xml is also in the META-INF folder, I also put the CDI dependencies,…
-
5
votes1
answer2036
viewsQ: @Enumerated(Enumtype.STRING) Hibernate JPA
I have the following field classificacao in a table. This field is filled in elsewhere and is filled with, only, 'P' or 'N', acronyms for Positive and Negative. I then created the enum Java.…
-
1
votes2
answers70
viewsQ: Maintenance problem with JPA query
I have the following packages and classes. When I’m going to do this JPA consultation, I need to go through the whole full Qualified name of the Class (as in the example) because JPA cannot find it…
-
1
votes1
answer293
viewsQ: Datasource Postgresql Widlfly
I’m trying to set up a DataSourcewith PostgreSQL, but you’re throwing this Exception 23:36:46,381 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0013:…
-
4
votes1
answer265
viewsQ: Encoding Eclipse -> Intellij
I imported a project into Intellij that was created in the eclipse. The project is pretty big. I’m having a problem with encoding, in the eclipse is as Default o Cp1252 And Intellij is into UTF-8…
-
2
votes3
answers692
viewsA: Financial calculation with decimal large numbers
To work with BigDecimal, well, you need to use BigDecimal. Operations with BigDecimal are using the methods that the class itself has add() to add substract() to subtract divide() to divide…
javaanswered Henrique Santiago 851 -
2
votes1
answer680
viewsQ: Gson Library Changing useful. Date
When using the library GSON for the manipulation of JSON, I realized that by doing the parsers the date is being changed, it’s tiny, but it’s enough to break my unit test with JUnit. Follow a sketch…
-
2
votes0
answers237
viewsQ: Problem in left Join JPA - JPQL
Exception in thread "main" javax.persistence.Entitynotfoundexception: Unable to find CNPJ with id 00001388000307 Reading the documentation, I saw that this Exception is released when it tries to…
-
0
votes1
answer726
viewsA: p:inputText is not updating
Because of the component <p:inputText> have a rule there of rendered, the processing of this component is skipped, that is, in the 'apply request values' phase the JSF "jumps" the processing…
-
1
votes1
answer726
viewsQ: p:inputText is not updating
I have in the following code, a form that works both to change and to add an entity. The logic is this, I have a variable alteracao. if alteracao == true the form will behave to change if alteracao…
-
1
votes1
answer490
viewsA: Generate columns with repeat Primefaces
Only use the <p:columns>, passing the array by the variable value and using the variable var <p:columns value="#{managedbean.colunas}" var="coluna" headerText="#{coluna}">…
-
2
votes1
answer490
viewsQ: Generate columns with repeat Primefaces
I’m unable to generate these columns dynamically with the p:repeat of the Primefaces. Is there no way to do this in Primefaces? Or is there no way to do it? There is a better solution? The problem…
-
1
votes1
answer39
viewsA: Filter in consultation
To bring only the records with the column LAB equal to Sim. Modify your query to: String query1 = "Select id_ct, ORDEM ,CDLINHA, TIPOL,SETOR ,TCPERFIL,BPCS,DPERFIL ,PROJETO ,OEM,N_DESENHO…
javaanswered Henrique Santiago 851 -
0
votes0
answers390
viewsQ: Maven plugin build error
I use the following plugins to compile and run my web project in Intellij IDEA: pom.xml //Código do pom.xml omitido . . . <dependency> <groupId>javax.servlet</groupId>…
-
0
votes1
answer320
viewsA: Graphic Primefaces with Consultation by Month and Year
His problem was with the scope of variables mesand ano that you were trying to update on some method and were unsuccessful. You can do the following. Create a class to represent this month and year.…
-
1
votes2
answers293
viewsA: MVC Doubt on Android
Regarding the DAO, it refers to the model, it has "nothing to do" with your Activity, if you need to access 3 models, that there are 3 different Daos, you will do it independently.
-
0
votes1
answer281
viewsA: Convertnumber JSF negative values
If the problem in simply using: <p:column> <h:outputText value="#{entidade.valorMonetário}"> <f:convertNumber type="currency"/> </h:outputText> </p:column> and the…
-
1
votes1
answer281
viewsQ: Convertnumber JSF negative values
Negative monetary values when using the native JSF converter, <f:convertNumber type="currency"/>, stand with the character '-', before R$. For example: -R$ 56.134.726,99 .xhtml…
-
0
votes2
answers57
viewsA: What is the equivalent of Arrow Function?
let results; this.$refs.myMap.$mapObject.data.toGeoJson(function(geojson){ results = JSON.stringify(geojson, null, 2); }); console.log( results ); No use Arrow functions…
javascriptanswered Henrique Santiago 851 -
0
votes1
answer75
viewsA: Equivalent to LEFT() sql function in JPA
No LEFT() function in jpa! The documentation restricts the capture of string portions only to the [function] SUBSTRING(). ex: select substring(v.campo, 1, 6), count(*) from V v group by…
-
0
votes1
answer75
viewsQ: Equivalent to LEFT() sql function in JPA
What is the LEFT() equivalent function in JPA? I need to take only the first 6 characters of a field. The equivalent select in sql would be: select left(campo,6), count(*) qtd from tabela group by…
-
0
votes1
answer34
viewsQ: Code redundancy in my . xhtml JSF - Primefaces
I have this table in 2 pages of my own and I ended up copying and pasting this code, the only thing I had to change was the "bean", in one I used "bean1", in the other I used "bean2". Is there a…
-
1
votes1
answer286
viewsQ: Bookmarks Eclipse Editor
Can anyone tell me what these markers are in the eclipse editor and how to get them out? I don’t know how they got there, what button I pushed, where I clicked.…
-
0
votes0
answers134
viewsQ: Update Hibernate
The situation is as follows, when placing the property <property name="hibernate.hbm2ddl.auto" value="update"/>, nothing else works, no query works anymore. log always ends with : jul 27, 2017…
-
5
votes5
answers21141
viewsA: What is the functionality of n?
BREAK LINES. the code: print "Fisrt line!\nSecond line!" has the following output:…
pythonanswered Henrique Santiago 851 -
1
votes1
answer360
viewsA: Bring all table records with jpa and eclipselink
With his em, do: Query query = em.createQuery("select u from Uf u"); List<Uf> ufs = query.getResultList();
-
0
votes1
answer878
viewsQ: Passing an Array of Strings to a preparedStatement?
I am trying to pass an array of Strings to a preparedStatement, but it’s returning this exception: java.sql.SQLFeatureNotSupportedException: This operation is not supported. at…
-
2
votes1
answer2359
viewsA: Return of "?" instead of the special characters in a SELECT
Uses the function of PHP utf8_encode(), utf8_encode($linha['modalidade']); Or change your table in the bank to SET=utf8 COLLATE utf8_unicode_ci…
-
0
votes1
answer479
viewsA: File path (Java Web)
That solves the problem. File myTempFile = new File(System.getProperty("java.io.tmpdir"),"temporary"); Serves exactly for a temporary file.
-
0
votes1
answer479
viewsQ: File path (Java Web)
I’m working on a web project and I’m having a problem with files(java.io.File). The problem is only when running the web application, if it is Java Application the problem does not exist. When…
-
1
votes1
answer194
viewsQ: Null in Primefaces Component Uploadfile
I am having trouble trying to recover that file,file, in my bean. .xhtml <h:form id="form" enctype="multipart/form-data"> <p:fileUpload value="#{bean.file}" skinSimple="true" mode="simple"…
-
1
votes2
answers185
viewsA: Relation between bean and view
I recommend this article manged Beans, do not complicate, simplify, but I’ll also give my opinion. If you guarantee that it will always be the same on all pages, and that nothing on any of the pages…
-
0
votes1
answer481
viewsA: Compare dates and validate only the same year
what you could do was SimpleDateFormat formatter = new SimpleDateFormat("yyyy"); String dataInicial = formatter.format(dtInicial) String dataFinal = formatter.format(dtFinal)…
-
-1
votes1
answer1305
viewsA: Can I get the list index inside for-each in java?
I’ve done a lot of research on this and many say there’s no way. I’ve also searched the javadoc and found nothing. I think the solution is to either use the is normal or use a counter within the…
javaanswered Henrique Santiago 851 -
1
votes2
answers580
viewsA: Redirecting JSF pages
You could use the web.xml for that reason <welcome-file-list> <welcome-file>/login.xhtml</welcome-file> </welcome-file-list>
-
0
votes1
answer277
viewsQ: Eclipse Debug - Classes with equal names in different projects
I was debugging here and I came across a curious situation. I already fucked, but I could not succeed in discovering the problem. On a project, I have the class EntidadeDAO in the project1. In…
-
6
votes4
answers829
viewsQ: Best approach is to filter data in the database or application?
Suppose we have a table 'Vendas' with the following columns 'estado', 'cidade', 'vendedor', 'valor'. 'estado' and the 'cidade' would be where the sale was held and 'vendedor' would be what made this…