seam3

How to write main() using CDI in Java EE?

时光总嘲笑我的痴心妄想 提交于 2020-01-14 04:24:34
问题 I have a no-client application that I wish to run. It will have no clients but it will make HTTP calls and act as client for other services. It would run for perhaps a few hours or days (but it will not require periodic runs -- just one-shot). I want to run it in a Java EE 7 container, because of the benefits of standard Context Dependency Injection (CD), and a standard JAX-RS client (new since Java EE 7). It is also nice to have services such as JMS, JPA. The question is how do I write /

Creating own scaffold plugin: metawidget resource loading exception only when run within forge console

拥有回忆 提交于 2019-12-24 20:23:27
问题 I try to rebuild a scaffold faces plugin separately for some reasons, but found a really annoying bug, that I cannot solve. java.lang.NoSuchMethodException: class org.metawidget.inspector.impl.BaseObjectInspectorConfig.setPropertyStyle(ForgePropertyStyle). Did you mean setPropertyStyle(PropertyStyle)? at org.metawidget.config.impl.BaseConfigReader$ConfigHandler.classGetMethod(BaseConfigReader.java:1633) After trying some tricks, review the metawidget config codes, not found how to solve the

@PostConstruct Interceptor with @Named @ViewScoped not invoked

十年热恋 提交于 2019-12-12 17:22:53
问题 I have read carefully the article about Interceptors in the Seam/Weld documentation and implemented a InterceptorBinding : @InterceptorBinding @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface MyLog {} and a Interceptor class: @MyLog @Interceptor public class ErpLogInterceptor implements Serializable { @AroundInvoke public Object logMethodEntry(InvocationContext invocationContext) throws Exception {..} @PostConstruct public Object

How to retrieve all existing long-running conversations in Weld?

我的未来我决定 提交于 2019-12-11 11:26:03
问题 I'm writing application in JBoss 7.1.1.Final, Weld, Seam 3. I have following bean: @ConversationScoped public class ConversationBean implements Serializable { @Inject Conversation conversation; private Article article; ... } Now, the user might create multiple conversations, each conversation will be associated with the instance of ConversationBean. I need to be able to get all those instances that are associated with long-running conversation. The reason why I need an access to them is that

How do you find CDI beans of/in the current view (scope)?

て烟熏妆下的殇ゞ 提交于 2019-12-10 15:16:22
问题 In a Java EE 6, CDI 1.1.x, Seam 3 etc. environment , we need to find all CDI beans of the current view ( @ViewScoped ). What I have tried so far is using: @Named @ViewScoped public class ViewHelper { @Inject private BeanManager beanManager; public doSomethingWithTheBeanInstances() { Set<Bean<?>> beans = this.getBeanManager().getBeans( Object.class, new AnnotationLiteral<Any>(){} ); // do something ... } } However, this returns all beans it manages. I need to find only those within the scope

How does Seam 3 handles the “redirect to capture view” feature after login?

我的未来我决定 提交于 2019-12-10 11:09:22
问题 Here is my use cases. I have a login page which is /public/login.xhtml . All my other pages are required to log-in before reaching them. They are in /pages/ directory. I want that : If my user access to http://host/myapp/pages/* it redirects him first to the login page, and then, to the URL he has firstly entered. If my user access to http://host/myapp/ , it redirects him first to the login page, and then, to /pages/home.xhtml . If my user access to http://host/myapp/public/login.xhtml , it

Lazy loading exception when using JSF Converter (refering to a collection)

∥☆過路亽.° 提交于 2019-12-10 10:18:38
问题 This is my first post after many research on this problem. This example is running under Jboss 7.1 with seam 3.1 (solder + persistence + faces) with seam managed persistence context I'm facing a problem, the classical failed to lazily initialize a collection, no session or session was closed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed when using a converter on Entity beans. The aim is to stay 100% Object oriented, by

How to write main() using CDI in Java EE?

强颜欢笑 提交于 2019-12-08 18:21:25
I have a no-client application that I wish to run. It will have no clients but it will make HTTP calls and act as client for other services. It would run for perhaps a few hours or days (but it will not require periodic runs -- just one-shot). I want to run it in a Java EE 7 container, because of the benefits of standard Context Dependency Injection (CD), and a standard JAX-RS client (new since Java EE 7). It is also nice to have services such as JMS, JPA. The question is how do I write / annotate the main method in a standard way? @Inject on a method is no good because such methods must

How does Seam 3 handles the “redirect to capture view” feature after login?

╄→гoц情女王★ 提交于 2019-12-06 11:12:46
Here is my use cases. I have a login page which is /public/login.xhtml . All my other pages are required to log-in before reaching them. They are in /pages/ directory. I want that : If my user access to http://host/myapp/pages/* it redirects him first to the login page, and then, to the URL he has firstly entered. If my user access to http://host/myapp/ , it redirects him first to the login page, and then, to /pages/home.xhtml . If my user access to http://host/myapp/public/login.xhtml , it redirects him first to the login page, and then, to /pages/home.xhtml . If my user access to http://host

Lazy loading exception when using JSF Converter (refering to a collection)

廉价感情. 提交于 2019-12-05 18:34:26
This is my first post after many research on this problem. This example is running under Jboss 7.1 with seam 3.1 (solder + persistence + faces) with seam managed persistence context I'm facing a problem, the classical failed to lazily initialize a collection, no session or session was closed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed when using a converter on Entity beans. The aim is to stay 100% Object oriented, by reusing the JPA model. in beans.xml, org.jboss.seam.transaction.TransactionInterceptor is activated