-
1. Re: Logging in and null outjected objects
pmuir Oct 3, 2007 7:55 AM (in response to oblivion1200)The code you have posted doesn't show how you make the outjection happen (perhaps you need a @Factory?)
-
2. Re: Logging in and null outjected objects
oblivion1200 Oct 3, 2007 8:15 AM (in response to oblivion1200)I am not logged in now. I click on that link on first page
<s:link view="/user.xhtml" action="#{bidder.outjectUser()}" value="#{auction.users.login}"/>
bidder object@Stateful @Name("bidder") public class Bidder implements _Bidder { @In(required=false) private Auctions auction; @PersistenceContext(type=PersistenceContextType.EXTENDED) private EntityManager entityManager; @Out(required=false,scope=ScopeType.SESSION) private Users auctionUser; public void outjectUser(){ auctionUser = auction.getUser(); }
Here goes logging, because:<page view-id="/user.xhtml" login-required="true" />
second page - user.xhtml<h:outputText value="Nick"/>:<h:outputText value="#{auctionUser.login}"/><br/> <h:outputText value="Imie"/>:<h:outputText value="#{auctionUser.name}"/><br/>
Outjection works ok when I am logged in. If I am not logged in , the login process erases outjected auctionUser and no value on user.xhtml is displayed. -
3. Re: Logging in and null outjected objects
pmuir Oct 3, 2007 8:21 AM (in response to oblivion1200)Using both an action and a view on s:link is a little odd. Try designing your app so you use one or other.
-
4. Re: Logging in and null outjected objects
oblivion1200 Oct 3, 2007 9:20 AM (in response to oblivion1200)It is my first seam application. Probably I made some design mistakes. I use both view and action on s:link, because I need to have outjected auctionUser to display on user.xhtml. User.xhtml has no backing bean, it only dispalys properties of outjected object. This object may come from many different beans. I don't need to outject auctionUser if someone don't go to user.xhtml. Should I use
<page view-id="*"> <navigation from-action="#{bidder.outjectUser}"> <redirect view-id="/user.xhtml"/> </navigation>
instead of<s:link view="/user.xhtml"
? -
5. Re: Logging in and null outjected objects
pmuir Oct 3, 2007 9:33 AM (in response to oblivion1200)Yes. I'm not sure if this will help with your exact problem, but it is much better :)
-
6. Re: Logging in and null outjected objects
oblivion1200 Oct 3, 2007 9:54 AM (in response to oblivion1200)Wow, it works now. Code like this does not work
<page view-id="*"> <navigation from-action="#{bidder.outjectUser}"> <redirect view-id="/user.xhtml"/> </navigation>
I had to use<page view-id="*"> <navigation from-action="#{bidder.outjectUser()}"> <redirect view-id="/user.xhtml"/> </navigation>
Thanks Pete for your help.