Posts by Roknauta • 2,811 points
221 posts
-
5
votes2
answers259
viewsA: Problems with bash - echo with char ! (exclamation)
There are 3 types of quotation marks on bash: Double quotes ("") : With them you can use strings and variable values. Ex: nome="Douglas" echo "Olá $nome" Olá Douglas Single quotes ('') : With these,…
-
0
votes1
answer51
viewsA: Table rows aligned to the right
Swap your css like this: value="#{row.totalQuantidadeProcesso}" style="float: right;"/>
-
0
votes1
answer203
viewsA: Delete method is not called when I click on a commandButton
In his commandButton change the ajax: ajax="false"
-
0
votes1
answer303
viewsA: Set Bean dynamically according to the registration screen
With Facelets this became easy, note in my case is an example you need, below we have a standard template for Cruds: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC…
-
0
votes0
answers50
viewsQ: Accented words with problems
In many projects jsf I don’t remember if I’ve ever had a problem like this but as the image below shows, the encoding is not correct. The problem is occurring in the java because I have accented…
-
0
votes1
answer244
viewsQ: Message is not being displayed
Inside my form has a autocomplete, When activating the autocomplete and if the previous field has not been filled I want to send a message stating that the previous field must be filled. I…
-
2
votes1
answer159
viewsQ: Load image after selected item
In my application the user defines a root directory. After defining the root there is the listing of files present in the directory. When the file is selected there is another directory where there…
-
0
votes2
answers225
viewsA: Inputtext returns null
In your ajax put the immediate: <p:ajax event="change" update="campoEspecifique" immediate="true"/>
-
1
votes1
answer311
viewsQ: Pass parameter with ajax
My application receives in the first field of the form a directory. Through this directory I will list the files present in it. I have a method that will list the files according to the received…
-
0
votes1
answer144
viewsQ: Unmarked class
I am testing a . jar where I will pass named parameters on the command line, etc. The problem is that you are not finding my main class. Somebody help me? package appOptions; import…
-
0
votes3
answers196
viewsA: Remove from Integer List
When you use the remove of the interface List you pass an index to remove as parameter or value. In your case it may be that it has more than a value 1 in the list and if yes it is removing the…
-
0
votes1
answer58
viewsA: What information can I get from the user through Java EE?
They need to pass the user and password to be validated, an example to help you would be this block of code that I implemented: public static boolean authenticateJndi(String username, String…
-
1
votes1
answer893
viewsA: How to popular a p:datatable with a List<> that contains two List<> attributes inside?
When you created your subTable you could have used the value of dataTable as a reference, example: <p:subTable var="bean" value="#{gastosMes}"> <f:facet name="header"> <h:outputText…
-
0
votes1
answer80
viewsA: Java library error in project
Your problem is related to jdk import, do this on: Properties (do seu projeto) > Java Build Path > Libraries e informe o caminho do seu jdk.
-
1
votes1
answer732
viewsA: List a user’s groups on an AD server
After much research and testing, I was able to solve: public static boolean authenticateJndi(String username, String password) throws Exception{ Properties props = new Properties();…
-
1
votes1
answer732
viewsQ: List a user’s groups on an AD server
I need to list a user’s groups X on the AD server. I have the following code snippet ready that already authenticates on the server and returns me all groups: public static boolean…
-
0
votes1
answer66
viewsQ: Parameter is not coming as null
I am working on the internationalization of my messages and their centralization. I have the following methods: private static void addMessage(Severity severity, String mensagem, Object...args){…
-
0
votes1
answer308
viewsQ: Ignore parameter if null
I have the following method that does a database search: public Collection<Habilidade> pesquisar(HabilidadeForm form) throws Exception { String query = "select u from Habilidade u where u.nome…
-
3
votes1
answer350
viewsQ: Change Sequence value with subselect
I have the following case: I need to change the value of some sequences according to the max(id) of the table, I am trying to do something like: ALTER SEQUENCE CFOP_SEQ INCREMENT BY (SELECT…
-
0
votes1
answer389
views -
3
votes1
answer282
viewsQ: Better definition of Entitymanager
I’m studying on JPA along with the Dependency Injection and read some points on the EntityManager: If we use the following method: public EntityManager getEntityManager() { EntityManagerFactory…
-
2
votes1
answer140
viewsQ: Set a group in regex
I’m testing the following regex: (?i)(\s|\W|)(fire|fire-type)(\s|\W) I have 2 problems: 1º Case (SOLVED) has only one word without spaces at the beginning or at the end my regex does not take. Ex:…
-
1
votes1
answer177
viewsQ: Show text while hovering on autocomplete
I have the following autocomplete: <p:autoComplete id="meuId" label="#{messages['mesage']}:" completeMethod="#{metodo}" var="bean" itemValue="#{bean.id}" itemLabel="#{bean.descritivo}"…
primefacesasked Roknauta 2,811 -
0
votes1
answer252
viewsQ: Show suggestions while typing autocomplete
I got the following autoComplete : <p:autoComplete id="geracao" value="#{habilidademb.habilidade.geracao}" completeMethod="#{habilidademb.listarGeracoes()}" dropdown="true" var="bean"…
-
0
votes1
answer37
viewsQ: I lost the project encoding
I installed the eclipse on my Windows computer and downloaded my project to continue the same, I had not noticed before, but on the screen that work, when I came across an error I realized that the…
-
4
votes1
answer102
viewsQ: Treat a word with dots
I have a method that takes a text as a parameter and makes a .split in the text separating the words by " ". For each word in the text I make a check to see if the word is equal to the item in my…
-
0
votes1
answer149
viewsA: Injected object but is null
Researching, I discovered that for Inject work in the convert you need to use the @Named instead of @FacesConverter, my convert got like this: @Named(value = "geracaoConverter") Source:…
-
0
votes3
answers109
viewsA: Value is not being written to the bank
Researching, I discovered that for Inject work in the convert you need to use the @Named instead of @FacesConverter, my convert got like this: @Named(value = "geracaoConverter") Source:…
-
0
votes1
answer149
viewsQ: Injected object but is null
I have an object that is injected into my converter : package br.com.pokemax.modelo.converter; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import…
-
0
votes3
answers109
viewsQ: Value is not being written to the bank
I have the following entities: package br.com.pokemax.modelo; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import…
-
2
votes1
answer360
viewsQ: How to search for ID’s in the bank and display the names on the screen?
In my JSF + Primefaces project, I have the following entities: @Entity @Table(name = "geracao") public class Geracao { @Getter @Setter @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private…
-
0
votes3
answers3802
viewsQ: Load a list of Enums
I have a selectOneMenu thus: <p:selectOneMenu id="diminui" value="#{naturemb.nature.diminui}" effect="clip"> <f:selectItems itemLabel="#{naturemb.carregarAtributos()}"…
-
4
votes2
answers253
viewsQ: Check and edit a List
I own a List: private List<Geracao> lista; This list will be filled with data from a database: lista = dao.findAll(); The method findAll() : @SuppressWarnings("unchecked") @Override public…
-
1
votes2
answers95
viewsQ: Validate text before going to the screen
I got the following dataTable: <p:dataTable id="tabela" var="c" value="#{geracaomb.lista}" paginator="true" rows="10" rendered="#{not empty geracaomb.lista}" paginatorPosition="top">…
-
4
votes2
answers466
viewsQ: Comparing words from a text to an Enum’s list
I have an Enum that contains a list of values. I have a method where I receive text as a parameter. This method, besides going through Enum, breaks the text by words. The main function of the method…
-
2
votes2
answers3265
viewsQ: How to go through Enum in Java
I have the following Enum: public enum TipoPokemon { FIRE("FIRE"), WATER("WATER"), GRASS("GRASS"), ELECTRIC("ELECTRIC"), ICE("ICE"), DARK("DARK"), GHOST("GHOST"), FAIRY("FAIRY"), PSYCHIC("PSYCHIC"),…
-
6
votes2
answers421
viewsQ: Group css selectors to reuse code
Given my and html and css respectively: <!DOCTYPE html> <html> <meta charset="UTF-8"> <head> <link rel="stylesheet" type="text/css" href="css/estilos.css">…
-
0
votes1
answer1211
viewsQ: Centralize components
The print below is from the confirmation of a record of my datatable, the popup is opened when you click on the delete record button: The code of this dialog is as follows:: <p:commandButton…
-
4
votes3
answers2837
viewsQ: How to rename a java file
Given my code below: import java.io.File; public class App { public static void main(String[] args) { File diretorio = new File("/home/douglas/roms"); File[] arquivos = diretorio.listFiles(); for…
-
1
votes1
answer212
viewsA: Infinite loop in java
It was simple, just assign the value of nameName to name. nome = nomeFinal;
-
0
votes1
answer212
viewsQ: Infinite loop in java
This my code aims to rename a mass of files to set the following pattern: All compound names, words must start in uppercase. First I give a substring for names that have only one word and then I…
-
0
votes1
answer49
viewsQ: Query returning unwanted result
In my sql statement: SELECT DISTINCT C.TABLE_NAME,C.CONSTRAINT_NAME,C.COLUMN_NAME FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE C INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS T ON T.TABLE_NAME…
-
2
votes2
answers761
viewsQ: Store paths containing directory with space in name
I have the following problem: I need you to store a path from an X directory in a variable in my script. The big problem is that one of the folders in this path contains space in the name and for…
-
0
votes2
answers199
viewsQ: Load objects from other classes
I have a selectOneMenu which will be used to list all Generations (data in the database). These data should be listed when registering a Nature object. My selectOneMenu is like this :…
-
1
votes2
answers313
viewsA: Upload Primefaces Directory
Edit the file web.xml and includes or changes the entry: <init-param> <param-name>uploadDirectory</param-name> <param-value>/path/to/uploads</param-value>…
-
2
votes1
answer189
viewsQ: Backup by mysqldump line by line
I am using mysqldump to export only my database data, but when exporting, it shows only one line with all the Inserts. Is it possible to make a registration insert per line? Ex: INSERT INTO TABELA()…
-
0
votes1
answer18
viewsQ: Place of message display
Look at the image below: Note that the validation message appears at the top, as I do so that it appears next to the corresponding fields and no longer appears at the top ?…
-
0
votes3
answers210
viewsA: How to create tables when starting Sisitema with JSF and JPA?
In my case I use the wildfly, I did the following: I set it up in the file standalone.xml the following entries: In <datasources I added: <datasource jndi-name="java:jboss/datasources/pokemax"…
-
3
votes2
answers1783
viewsA: Using variable with the sed command
Just use double quotes instead of single quotes: DirUpload=/var/log find $DirUpload | sed "s/$DirUpload//g"
-
2
votes1
answer72
viewsA: Backup and deploy with shell script
This script will help you, you can edit it at will: #!/bin/bash # Pasta Backup backup="/home/arcadian/workspace/works/backup" #Pasta Prod prod="/home/arcadian/workspace/works/prod" #Pasta Upload…
shell-scriptanswered Roknauta 2,811