seam

Seam 2.3, JSF 2.0 - Conversation propagation for <h:selectOneMenu />

感情迁移 提交于 2019-12-13 15:24:28
问题 I'm in the process of migrating our primary application from Seam 2.2 to Seam 2.3beta1, in order to get some of the benefits of JSF 2.0 and JPA 2.0. For the most part, it's going smoothly. However, some of the Ajax changes in JSF 2.0 and Richfaces 4.x are proving to be problematic in porting the code. I have a series of components that are populated based on the contents of the others. For example, the first menu selects the item category. When a value is selected, the subcategories of that

End Conversation in Seam when the user leaves the page

我们两清 提交于 2019-12-13 14:02:14
问题 Is there some way to end a conversation in Seam 2 when the user leaves the page? I know, that I can of course end a conversation in the navigation rules( see this post), but I want to end a conversation when the user enters an url in the address bar of the browser. Could this be achieved via Javascript (for example with onbeforeunload)? But how to stop a conversation via javascript? 回答1: I want to end a conversation when the user enters an url in the address bar of the browser. Could this be

Mock @org.jboss.seam.annotations.in behaviour for unittest

有些话、适合烂在心里 提交于 2019-12-13 05:41:55
问题 The test: public class BeanTest { private SomeBean target; @Test(groups = "integration") public void checkIfAuthenticationWorks() { ApplicationBean applicationBean = mock(ApplicationBean.class); target = new SomeBean(); // Some cool code to inject applicationBean to target class assertEquals("token", target.authenticate(USERNAME, PASSWORD)); } } The class: @AutoCreate @Name("someBean") @Scope(ScopeType.SESSION) public class someBean implements Serializable { @Logger private static Log log;

Move a seam application to OSGI

对着背影说爱祢 提交于 2019-12-13 02:29:11
问题 i' ve some web applications developed using Seam Framework 2.3 + jBoss AS 7 + Hybernate. Since i' ve been studying OSGI for a while, i was wondering if is possible to move my applications to the osgi world for modularizing everything; i' ve read a lot of blogs and these interesting discussions as well (how-to-modularize-an-enterprise-application-with-osgi-and-ee6 and how-to-modularize-a-jsf-facelets-spring-application-with-osgi) but honestly i still don't really know where i should start from

How to inject a property from Tomcat's context.xml into a Seam component?

萝らか妹 提交于 2019-12-12 20:53:23
问题 The Seam documentation would have you believe that if you define a property in web.xml, or through a -D argument, it will find it and automatically set it on your bean. So if you have a bean called gateway with a property login and a setter, you can make a property called gateway.login in seam.properties, but if you define it in a -D, you have to use org.seam.properties.gateway.login. I got that to work (with the -D that is), but I could not get it to see either &Parameter or &Environment

Shorten path of REST service in JBoss Seam application

会有一股神秘感。 提交于 2019-12-12 18:17:30
问题 I'm pretty new to JBoss and Seam. My project has a REST service of the style @Path("/media") @Name("mediaService") public class MediaService { @GET() @Path("/test") public Response getTest() throws Exception { String result = "this works"; ResponseBuilder builder = Response.ok(result); return builder.build(); } } I can reach this at http://localhost:8080/application/resource/rest/media/test . However, I don't like this URL at all and would prefer something much shorter like http://localhost

SEAM - get url of base65 authentication

泄露秘密 提交于 2019-12-12 18:16:10
问题 I have this config in my components.xml: <web:authentication-filter url-pattern="/resource/rest/*" auth-type="basic"/> <security:identity authenticate-method="#{basicAuthenticator.login}"/> Well, my basicAuthenticator is a Stateless seam component where i have that login method which returns true/false depending on credentials. I do really want to find the host (url adress) of the request. Of course i can use ExternalContext like: @In(value = "#{facesContext.externalContext}", required =

How to rewrite the URL

走远了吗. 提交于 2019-12-12 11:23:08
问题 I have a small application built using Seam 2.2, Richfaces 3.3, JBoss 5.1. Most of the page navigation adds the request parameters to the target URL. I would like to hide parameters to be hidden to the customer who is using the application (e.g. I would expect the URL to be something like "http://localhost:8080/books/Book.seam". The parameters (userId, orderId and cmId) are currently mapped to the backend bean via Book.page.xml. How do I prevent the request parameters from showing up in the

Practical value for concurrent-request-timeout parameter or options for avoiding concurrent access to conversation exception

半腔热情 提交于 2019-12-12 08:14:07
问题 In the Seam Reference Guide, one can find this paragraph: We can set a sensible default for the concurrent request timeout (in ms) in components.xml: <core:manager concurrent-request-timeout="500" /> However, we found that 500 ms is not nearly enough time for most of the cases we had to deal with, especially with the severe restriction seam places on conversation access. In our application we have a combination of page scoped ajax requests (triggered by various user actions), some global

Show success message and then redirect to another page after a timeout using PageFlow

ε祈祈猫儿з 提交于 2019-12-12 07:56:43
问题 How can I show a success message and then redirect the user to another page after a timeout of e.g. 5 seconds? I need this for the login page after a successful login. I tried the following and I can see the warning message on login failure, but not the success message on login success. It shows immediately the target page. public String check(){ if (username.equals("test") && password.equals("test")) { FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY