seam

Startup POJO On A Weld/Seam3 Application

≡放荡痞女 提交于 2019-12-01 09:33:09
问题 I'm trying to get a POJO starting on startup within my Weld/Seam3 application but not having much luck. I've tried the following but none of them have worked: @Singleton public class StartupJobs { @Inject private Logger log; public void onStartup(@Observes @Initialized ServletContextEvent event) { log.info("Starting startup jobs"); } public void onStartupTwo(@Observes @Initialized WebApplication webApplication) { log.info("Starting startup jobs"); } } - // Guessing this way is no good as I

How can I start a process on the start of a Seam application

妖精的绣舞 提交于 2019-12-01 06:35:32
I tried annotating the class with the scopetype APPLICATION and a method with the @Create, @Beg, but this doesn't seem to work. What I want is to start an infinite loop right when the application starts. If you want a method to be executed right after initialization you can use the folowing annotation: @Observer("org.jboss.seam.postInitialization") You can annotate your class with the @Startup annotation. 来源: https://stackoverflow.com/questions/2093650/how-can-i-start-a-process-on-the-start-of-a-seam-application

How can I start a process on the start of a Seam application

守給你的承諾、 提交于 2019-12-01 05:29:17
问题 I tried annotating the class with the scopetype APPLICATION and a method with the @Create, @Beg, but this doesn't seem to work. What I want is to start an infinite loop right when the application starts. 回答1: If you want a method to be executed right after initialization you can use the folowing annotation: @Observer("org.jboss.seam.postInitialization") 回答2: You can annotate your class with the @Startup annotation. 来源: https://stackoverflow.com/questions/2093650/how-can-i-start-a-process-on

How to use view scope in case of CDI in JSF 2.0

可紊 提交于 2019-11-30 23:11:53
I created a JSF 2.0 project in Netbeans 6.9. I am starting using CDI. After creating project when i tried to add scope, then i noticed that there is no viewscope in it. I want to know that are the conversation scope and view scope refer to same things? Can i use conversation scope in place of view scope. If no then how can i use view scope with CDI. I also came to know that seam is the solution, but how can i use seam with netbeans. Is there any netbeans plugin for seam? seam-3 Thanks There is no view scope for CDI. The conversation scope is not the same. A view scoped bean lives as long as

How do I prevent form resubmission in Seam?

怎甘沉沦 提交于 2019-11-30 20:27:47
I have a simple form that I don't want accidentally submitted multiple times. I can easily block the user from multiple clicks when they first see the page, but I have no control over them hitting the back button. So, having worked with Struts, I decided that a form submit token was the way to go. Is there an easier way? Is this functionality already in Seam? If there isn't, how should I go about building this functionality into Seam? // EDIT // Just a clarification here, I do NOT need something that will keep the user from double- clicking. That is already solved. The specific use-case is as

JPA Entiy on synonym instead of table

眉间皱痕 提交于 2019-11-30 19:35:12
I have a Seam 2.2 based Java EE 5 web application with a bunch of tables mapped to JPA 1.0 Entities via Hibernate 3.3.3. During development it's running on a Tomcat 6, Oracle 10 XE and Windows 7. Now, we had the request by operations department to split the data model into one schema being the owner of all database objects ( myschema ) and one schema acting as the application's database user ( myschema_app ). So I did the following: create schema myschema_app grant object rights on all necessary tables from myschema (both regular ones and n:m intermediate tables) and sequences depending on the

How to use view scope in case of CDI in JSF 2.0

我与影子孤独终老i 提交于 2019-11-30 17:48:45
问题 I created a JSF 2.0 project in Netbeans 6.9. I am starting using CDI. After creating project when i tried to add scope, then i noticed that there is no viewscope in it. I want to know that are the conversation scope and view scope refer to same things? Can i use conversation scope in place of view scope. If no then how can i use view scope with CDI. I also came to know that seam is the solution, but how can i use seam with netbeans. Is there any netbeans plugin for seam? seam-3 Thanks 回答1:

Hibernate/JPA - Entity listener not being called properly

安稳与你 提交于 2019-11-30 15:32:44
问题 I'm trying to leverage EntityListener objects and callback methods within my Seam/Hibernate/JPA application. I'm using a Seam 2.2-managed persistence context on JBoss 5.1 with PostgreSQL 9.1 on the backend. I have the following entity declared: @Entity(name = "TestEntity") @EntityListeners(TestCallback.class) @Table(name = "tbl_test") public class TestEntity implements Serializable { private static final long serialVersionUID = 2016897066783042092L; @Id @GeneratedValue(strategy =

checks for constraint violation before persisting an entity

≡放荡痞女 提交于 2019-11-30 14:42:01
问题 What is the best mechanism for preventing constraint violation checks before creation | modification of an entity? Suppose if the 'User' entity has 'loginid' as the unique constraint, would it be wise to check if there is an user entry already with this loginid name before creation or modification. OR Would you let the database throw an ConstraintViolationException and handle this message appropriately in the UI layer. Where should such checks be enforced in the jboss seam framework. Note:

Hibernate/JPA - Entity listener not being called properly

走远了吗. 提交于 2019-11-30 14:21:37
I'm trying to leverage EntityListener objects and callback methods within my Seam/Hibernate/JPA application. I'm using a Seam 2.2-managed persistence context on JBoss 5.1 with PostgreSQL 9.1 on the backend. I have the following entity declared: @Entity(name = "TestEntity") @EntityListeners(TestCallback.class) @Table(name = "tbl_test") public class TestEntity implements Serializable { private static final long serialVersionUID = 2016897066783042092L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "xxx") @SequenceGenerator(name = "xxx", sequenceName = "xxx") @Index(name =