[JBoss Seam] - Re: identity.hasRole problem
by anescu
Ok, now I'm really confused!
So, now i've tried the following:
In the authenticator class
public boolean authenticate()
| {
| ...
| Identity.instance().addRole( new String( "account_admin" ) );
| ...
| System.out.println( "### account_admin: " + Identity.instance().hasRole( new String( "account_admin" ) ) );
| ...
| }
and in another class:
@In( required = false )
| Identity identity;
| ...
|
| public Collection getValues()
| {
| System.out.println( "### again account_admin: " + identity.hasRole( new String( "account_admin" ) ) );
| }
The method is called to populate a select box on the interface.
So, in the first class, the answer is false, and in the second the answer is true. How can this be possible? I need to be able to load some objects based on the roles of the user, I suppose the best way to do this is from the authentication method, but apparently I can't, because of the result I get. Anyone knows if I'm missing something, or if this is a known bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045442#4045442
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045442
19 years, 1 month
[JBoss Seam] - Event context ends before the response
by kirby
I've a very simple xhtml (facelets) page called "p1.xhtml" with this code:
| <h:form>
| <h:inputText value="#{testAction.x}"/>
| <h:commandButton value="Click me!" action="#{testAction.doSomething}"/>
| </h:form>
|
TestAction is a bean with this code:
| @Name("testAction")
| public class TestAction {
| public String x;
| ..... getter and setter of x .....
| public String doSomething() { return "/p1.seam"; }
|
I've got a strange behaviour: if the scope of the TestAction component is EVENT, the value of the text field is NOT present in the text field after the submit (even if it gets correctly submitted).
If the scope of the TestAction component is CONVERSATION (even with NO long running conversation active) the value is present (it appears in the text box after the submit).
Now, shouldn't the EVENT scope last for a request / response cycle (even the response render?). It seems like the component gets destroyed and recreated before the render response phase.
Shouldn't the CONVERSATION scope last as the EVENT one when there's no active long-running conversation?
Thank you for your support.
Salvatore Insalaco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045438#4045438
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045438
19 years, 1 month