Questions tagged as 'java-ee'

3
answers

Convert date with timezone

new Date () in javascript returns me this format:    Tue Apr 01 2014 13:43:13 GMT-0300 (BRT) I need to convert this to a java.util.Date. For this I am trying to use SimpleDateFormat () but I did not find a pattern that worked, it always r...
asked by 01.04.2014 / 18:51
2
answers

@PreDestroy in @ViewScoped

I noticed that @PreDestroy in beans with @ViewScoped scope is only called if the session that was active expired or if I forced a page redirect (? faces-redirect = true). Without these conditions, the bean with that scope is never destroyed, and...
asked by 27.08.2014 / 20:14
2
answers

Is it possible to limit the amount of rows of a class attribute that is a list via JPQL?

I have the following query in JPQL FROM User u INNER JOIN FETCH u.enderecos e WHERE u.id =:id ORDER BY e.id DESC A user can have more than ten addresses, so we want to bring only ten addresses and if the user wants, he loads ten times. I...
asked by 25.08.2014 / 19:58
1
answer

Problems using JSTL

I'm implementing a WEB application with J2EE, but I'm not able to list the data coming from the ServletListCourses to the Liste.Jsp page that uses JSTL. public class ServletListarCursos extends HttpServlet { private static final long...
asked by 11.02.2015 / 11:31
1
answer

How to add data to a list whenever a p: hotkey is used?

I have <p:hotkey> which is the component of Primefaces to work with shortcuts. Every time I press ctrl + 1 two new fields appear on the page, however I would like every time I press this combination the data that is in imputT...
asked by 17.08.2015 / 16:22
2
answers

Jboss - "Unable to get managed connection for java: / AppDS"

The following exceptions are occurring in my application: 10:52:34,506 ERROR [br.com.app.dao.NotificacaoDAO] (http--0.0.0.0-8080-77) java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/...
asked by 22.02.2014 / 00:53
1
answer

Error running function for the second time

Inside the controller I have this function: public void salvaEncaminhamento() { Integer qtdEncaminhamento = 0; if (manifestacao.getTbEncaminhamentoCollection() != null) { qtdEncaminhamento = manifestacao.getTbEncaminhamentoCol...
asked by 04.09.2017 / 19:14
2
answers

Problems with JPA - Hibernate does not persist EVERY object

Good morning guys! I have the following entities: package br.com.sistema.entidade; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistenc...
asked by 26.12.2014 / 17:57
2
answers

Maven Project with Hibernate and Glassfish does not generate the database

I have a Maven project and I'm having problems at the moment of generating the Database, I'm using Hibernate and Glassfish 4. No error is generated, simply the database is not generated, I'm new to Maven I may be forgetting some additional co...
asked by 10.03.2015 / 13:15
1
answer

How to properly reuse business rules using EJBs?

I am refactoring a system where the greatest concern is to decrease the coupling and complexity of the various levels of inheritance, so the examples are illustrative. I have the entities Contrato , ContratoUso and ContratoAde...
asked by 11.12.2014 / 19:55