You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ur...@bluemail.ch on 2005/10/18 23:56:34 UTC

Conditional include in JSF page

Hello

Who can give me a working solution for a conditional include.
In the config file a have this entry

  <managed-bean>
    <description>Partner</description>
    <managed-bean-name>Partner</managed-bean-name>
    <managed-bean-class>org.partneragency.web.PartnerBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>

In the partner bean I the loggedIn property which is true if the partner
is logged in.
I need a working code like this
    if not loggedIn then
      include page login.jsp

What can I realize this?

Thanks

Urs


Re: Conditional include in JSF page

Posted by Andrew robinson <an...@gmail.com>.
FYI, if you are using seam, they have a logged-in injector in their examples
that does this without an include (an auto redirect to the login page)

On 10/19/05, Martin van den Bemt <mv...@ibl-software.nl> wrote:
>
> It would be nice if you found a way to say how you achieved it, so
> others can learn from that too...
>
> Mvgr,
> Martin
>
> urswagner@bluemail.ch wrote:
> > I found a way. If You have an elegant solution You tell it me.
> >
> >
> >>-- Original-Nachricht --
> >>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
> >>Date: Tue, 18 Oct 2005 23:56:34 +0200
> >>From: urswagner@bluemail.ch
> >>Subject: Conditional include in JSF page
> >>To: users@myfaces.apache.org
> >>
> >>
> >>
> >>Hello
> >>
> >>Who can give me a working solution for a conditional include.
> >>In the config file a have this entry
> >>
> >> <managed-bean>
> >> <description>Partner</description>
> >> <managed-bean-name>Partner</managed-bean-name>
> >> <managed-bean-class>org.partneragency.web.PartnerBean
> </managed-bean-class>
> >> <managed-bean-scope>request</managed-bean-scope>
> >> </managed-bean>
> >>
> >>In the partner bean I the loggedIn property which is true if the partner
> >>is logged in.
> >>I need a working code like this
> >> if not loggedIn then
> >> include page login.jsp
> >>
> >>What can I realize this?
> >>
> >>Thanks
> >>
> >>Urs
> >>
> >
> >
> >
>

Re: Conditional include in JSF page

Posted by Martin van den Bemt <mv...@ibl-software.nl>.
It would be nice if you found a way to say how you achieved it, so 
others can learn from that too...

Mvgr,
Martin

urswagner@bluemail.ch wrote:
> I found a way. If You have an elegant solution You tell it me.
> 
> 
>>-- Original-Nachricht --
>>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>>Date: Tue, 18 Oct 2005 23:56:34 +0200
>>From: urswagner@bluemail.ch
>>Subject: Conditional include in JSF page
>>To: users@myfaces.apache.org
>>
>>
>>
>>Hello
>>
>>Who can give me a working solution for a conditional include.
>>In the config file a have this entry
>>
>> <managed-bean>
>>   <description>Partner</description>
>>   <managed-bean-name>Partner</managed-bean-name>
>>   <managed-bean-class>org.partneragency.web.PartnerBean</managed-bean-class>
>>   <managed-bean-scope>request</managed-bean-scope>
>> </managed-bean>
>>
>>In the partner bean I the loggedIn property which is true if the partner
>>is logged in.
>>I need a working code like this
>>   if not loggedIn then
>>     include page login.jsp
>>
>>What can I realize this?
>>
>>Thanks
>>
>>Urs
>>
> 
> 
> 

RE: Conditional include in JSF page

Posted by ur...@bluemail.ch.
I found a way. If You have an elegant solution You tell it me.

>-- Original-Nachricht --
>Reply-To: "MyFaces Discussion" <us...@myfaces.apache.org>
>Date: Tue, 18 Oct 2005 23:56:34 +0200
>From: urswagner@bluemail.ch
>Subject: Conditional include in JSF page
>To: users@myfaces.apache.org
>
>
>
>Hello
>
>Who can give me a working solution for a conditional include.
>In the config file a have this entry
>
>  <managed-bean>
>    <description>Partner</description>
>    <managed-bean-name>Partner</managed-bean-name>
>    <managed-bean-class>org.partneragency.web.PartnerBean</managed-bean-class>
>    <managed-bean-scope>request</managed-bean-scope>
>  </managed-bean>
>
>In the partner bean I the loggedIn property which is true if the partner
>is logged in.
>I need a working code like this
>    if not loggedIn then
>      include page login.jsp
>
>What can I realize this?
>
>Thanks
>
>Urs
>