You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by No Galz <an...@yahoo.com> on 2004/11/19 13:04:00 UTC

Struts and my faces

Hello myfaces users,

I need an advice. I have a big application which is
completely struts based. But i would like to use the
JSF components (myfaces imple.) with my present struts
based app. 

Question) Is it possible to integrate the JSF+Struts
with myfaves impl. using the JSF+Struts integration
library??

Thanks in advance.

Regards
fargo


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


Re: populate resultSet

Posted by Francesco Consumi <co...@istitutodeglinnocenti.it>.
Scrive Manfred Geiler <ma...@apache.org>:
....snip.....

many thanks for explainations. Now it is clear.

For the moment I've solved problem calling the "populate()" method inside the
action param of Save button.
But I keep searching a more general solution. I've a lot of dataTables without
filters, but that have to be filled just before showing......






--
Francesco Consumi
Ufficio Sistemi informativi
Istituto degli Innocenti
Piazza SS.Annunziata, 12
50122 Firenze
consumi at istitutodeglinnocenti.it
Tel. +39 055 2037320
ICQ# 12516133


Re: populate resultSet

Posted by Manfred Geiler <ma...@apache.org>.
There is a problem with rendered="#{bean.list.count > 0}" (or better 
rendered="#{not empty bean.list}") for a dataTable in principle:
Imagine the following scenario:
- We have a list page with some kind of filter criterias in a form
- The first time the page is rendered with an empty list
- After a submit the page is rendered again. Per definition the rendered 
attribute is calculated early during the first lifecycle phase. Should 
we refresh the list before the restore state or apply request values phase?
--> if yes, we would refresh the list from the DB with wrong query 
criterias, because the filter inputs have not yet been propagated to the 
model beans (this happens in updateModel phase).
--> if no, we use the old list (which is still empty) and the rendered 
attribute evaluates to false. That means our list component does not 
participate in lifecycle processing at all. So, the new filter criterias 
would perhaps give a non-empty list, but the list would not be rendered.

A stand-off situation!
Conclusion: In a situation where inputs on the page influence the size 
of the list (i.e. filter form inputs), never use the rendered attibute 
in a dataTable to determine if the list is empty or not empty.

HTH,
Manfred


Francesco Consumi wrote:
> Scrive Manfred Geiler <ma...@apache.org>:
> 
>> This is the culprit:  rendered="#{mb.rsTelxSett.count > 0}"
>> Please use the renderedIfEmpty attribute instead:
>>
> I've just tried, and for some aspects it works: the getList method is being
> called  "only" times... :-)
> 
> the better place, I think, should be an hypothetical "OnPageLoad" 
> action.......
> 
> 
> 
> 
> 
> -- 
> Francesco Consumi
> Ufficio Sistemi informativi
> Istituto degli Innocenti
> Piazza SS.Annunziata, 12
> 50122 Firenze
> consumi at istitutodeglinnocenti.it
> Tel. +39 055 2037320
> ICQ# 12516133
> 
> 
> 

Re: populate resultSet

Posted by Francesco Consumi <co...@istitutodeglinnocenti.it>.
Scrive Manfred Geiler <ma...@apache.org>:

> This is the culprit:  rendered="#{mb.rsTelxSett.count > 0}"
> Please use the renderedIfEmpty attribute instead:
>
I've just tried, and for some aspects it works: the getList method is being
called  "only" times... :-)

the better place, I think, should be an hypothetical "OnPageLoad" 
action.......





--
Francesco Consumi
Ufficio Sistemi informativi
Istituto degli Innocenti
Piazza SS.Annunziata, 12
50122 Firenze
consumi at istitutodeglinnocenti.it
Tel. +39 055 2037320
ICQ# 12516133


Re: populate resultSet

Posted by Manfred Geiler <ma...@apache.org>.
This is the culprit:  rendered="#{mb.rsTelxSett.count > 0}"
Please use the renderedIfEmpty attribute instead:

Excerpt from the TLD:
8X-------------------------------------------------------
<attribute>
             <name>renderedIfEmpty</name>
             <required>false</required>
             <rtexprvalue>false</rtexprvalue>
             <description>
                 Indicates whether this table should be rendered if the 
underlying DataModel is
                 empty.
                 You could as well use rendered="#{not empty 
bean.list}", but this one causes
                 the getList method of your model bean beeing called up 
to five times per
                 request, which is not optimal when the list is backed 
by a DB table.
                 Using renderedIfEmpty="false" solves this problem, 
because the MyFaces
                 extended HtmlDataTable automatically caches the 
DataModel and calles the
                 model getter only once per request.
                 Default: true
             </description>
         </attribute>
8X-------------------------------------------------------

HTH,
Manfred



Francesco Consumi wrote:
> Scrive Manfred Geiler <ma...@apache.org>:
> 
>> Francesco,
>> Just place your "populate()" call into your getList method, use the
>> <x:dataTable> instead of <h:dataTable>, set the "preserveData" attribute
>> to true and lean back. ;-)
>> There is some (not yet neatly documented) magic inside the extended data
>> table that makes the component do call your getList method only once per
>> request.
> 
> 
> Thanks, but I'm sorry to inform you that even if I use x:dataTable, the
> "getList" method is being called at least 8 (eight) times....
> 
> here is the dataTable code:
> "result" is the ArrayList populated. I've to populate it at every page 
> request
> because its query depends on some parameters that the user can select in 
> form
> in order to filter result set.
> 
> 
>            <x:dataTable var="g" value="#{mb.rsTelxSett.result}"
>                         styleClass="standardTable"
>                         headerClass="standardTable_SortHeader"
>                         footerClass="standardTable_Footer"
> 
> columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnRight,standardTable_ColumnRight" 
> 
>                         rendered="#{mb.rsTelxSett.count > 0}"
>                         preserveDataModel="true">
>              <f:facet name="header">
>                <h:panelGroup>
>                  <h:outputText value="Statistiche telefono"/>
>                </h:panelGroup>
>              </f:facet>
>              <h:column id="c0">
>                <f:facet name="header"><h:outputText value="Utente"
> id="h0"/></f:facet>
>                <h:outputText value="#{g.COGNOMENOME}" id="c1Text0"/>
>              </h:column>
>              <h:column id="c1">
>                <f:facet name="header"><h:outputText value="Codice"
> id="h1"/></f:facet>
>                <h:outputText value="#{g.CODICE}" id="c1Text"/>
>              </h:column>
>              <h:column id="c2">
>                <f:facet name="header"><h:outputText value="Centro di Costo"
> id="h2"/></f:facet>
>                <h:outputText value="#{g.NOME}" id="c1Text2"/>
>              </h:column>
>              <h:column id="c3">
>                <f:facet name="header"><h:outputText value="Scatti"
> id="h3"/></f:facet>
>                <h:outputText value="#{g.TOT}" id="c1Text3"/>
>              </h:column>
>              <h:column id="c4">
>                <f:facet name="header"><h:outputText value="Costo totale"
> id="h4"/></f:facet>
>                <h:outputText value="#{g.COSTOTOT}" id="c1Text4">
>                  <f:convertNumber type="currency"/>
>                </h:outputText>
>              </h:column>
>            </x:dataTable>
> 
> 
> 
> many thanks for support.
> 
> -- 
> Francesco Consumi
> Ufficio Sistemi informativi
> Istituto degli Innocenti
> Piazza SS.Annunziata, 12
> 50122 Firenze
> consumi at istitutodeglinnocenti.it
> Tel. +39 055 2037320
> ICQ# 12516133
> 
> 
> 

Re: populate resultSet

Posted by Francesco Consumi <co...@istitutodeglinnocenti.it>.
Scrive Manfred Geiler <ma...@apache.org>:

> Francesco,
> Just place your "populate()" call into your getList method, use the
> <x:dataTable> instead of <h:dataTable>, set the "preserveData" attribute
> to true and lean back. ;-)
> There is some (not yet neatly documented) magic inside the extended data
> table that makes the component do call your getList method only once per
> request.

Thanks, but I'm sorry to inform you that even if I use x:dataTable, the
"getList" method is being called at least 8 (eight) times....

here is the dataTable code:
"result" is the ArrayList populated. I've to populate it at every page request
because its query depends on some parameters that the user can select in form
in order to filter result set.


            <x:dataTable var="g" value="#{mb.rsTelxSett.result}"
                         styleClass="standardTable"
                         headerClass="standardTable_SortHeader"
                         footerClass="standardTable_Footer"

columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnRight,standardTable_ColumnRight"
                         rendered="#{mb.rsTelxSett.count > 0}"
                         preserveDataModel="true">
              <f:facet name="header">
                <h:panelGroup>
                  <h:outputText value="Statistiche telefono"/>
                </h:panelGroup>
              </f:facet>
              <h:column id="c0">
                <f:facet name="header"><h:outputText value="Utente"
id="h0"/></f:facet>
                <h:outputText value="#{g.COGNOMENOME}" id="c1Text0"/>
              </h:column>
              <h:column id="c1">
                <f:facet name="header"><h:outputText value="Codice"
id="h1"/></f:facet>
                <h:outputText value="#{g.CODICE}" id="c1Text"/>
              </h:column>
              <h:column id="c2">
                <f:facet name="header"><h:outputText value="Centro di Costo"
id="h2"/></f:facet>
                <h:outputText value="#{g.NOME}" id="c1Text2"/>
              </h:column>
              <h:column id="c3">
                <f:facet name="header"><h:outputText value="Scatti"
id="h3"/></f:facet>
                <h:outputText value="#{g.TOT}" id="c1Text3"/>
              </h:column>
              <h:column id="c4">
                <f:facet name="header"><h:outputText value="Costo totale"
id="h4"/></f:facet>
                <h:outputText value="#{g.COSTOTOT}" id="c1Text4">
                  <f:convertNumber type="currency"/>
                </h:outputText>
              </h:column>
            </x:dataTable>



many thanks for support.

--
Francesco Consumi
Ufficio Sistemi informativi
Istituto degli Innocenti
Piazza SS.Annunziata, 12
50122 Firenze
consumi at istitutodeglinnocenti.it
Tel. +39 055 2037320
ICQ# 12516133


Re: populate resultSet

Posted by Manfred Geiler <ma...@apache.org>.
Francesco,
Just place your "populate()" call into your getList method, use the 
<x:dataTable> instead of <h:dataTable>, set the "preserveData" attribute 
to true and lean back. ;-)
There is some (not yet neatly documented) magic inside the extended data 
table that makes the component do call your getList method only once per 
request.

HTH,
Manfred


Francesco Consumi wrote:
> Hi people,
> 
> I've some doubt about the best way of populating a result set:
> 
> <h:dataTable value="#{bean.List}"...../>
> 
> I've a dataTable linked to an ArrayList. I populate the array list with 
> result
> of a query.
> what do you think is the best place to place call to "populate()" method ?
> if I put that call in "getList" method of bean, the populate() is being 
> called a
> lot of times. If I call it once in bean() main procedure, the result is 
> not kept
> up to date.
> 
> thanks,
> 
> 
> -- 
> Francesco Consumi
> Ufficio Sistemi informativi
> Istituto degli Innocenti
> Piazza SS.Annunziata, 12
> 50122 Firenze
> consumi at istitutodeglinnocenti.it
> Tel. +39 055 2037320
> ICQ# 12516133
> 
> 
> 

Re: Wanted: 2 very new features

Posted by Hendrik Neumann <he...@web.de>.
Thank you very much for your help Matthias and David. Is it already possible 
to use the tree-component for navigation specified in the faces-config?

Re: Wanted: 2 very new features

Posted by David Le Strat <dl...@yahoo.com>.
Hendrik,

If you take the latest from CVS, you will find some
examples in the demo application that should help you
getting started.

FYI - I just submitted a patch so that the tree table
component can support checkboxes per row an other
fixes.  It will probably take a few days before it
makes to the HEAD.  A myFaces committer will first
have to review the code.

Regards,

David.

--- Hendrik Neumann <he...@web.de> wrote:

> Isn't there anybody who can help me? Please - I
> would love to implement these 
> 2 features..
> 
> Am Freitag, 3. Dezember 2004 13:58 schrieb Hendrik
> Neumann:
> > Hi there,
> >
> > I'm currently developing a "Knowledge and method
> base for shape memory
> > alloys" (similar to a CMS) for the Ruhr-University
> of Bochum (in Germany)
> > and I'm using JSF-MyFaces for this web-application
> (thanks a lot for this
> > great work!).
> >
> > To pursue a strict scheme I'm droolin over 2 very
> interesting
> > MyFaces-Features: The new WISIWYG-Editor from
> Sylvain Vieujot ("New
> > x:htmlEditor", http://kupu.oscom.org/) and the new
> tree-component-features
> > from David Le Strat ("[Patch] Added Tree Table
> Support to Existing Tree
> > Component.",
> http://nagoya.apache.org/jira/browse/MYFACES-8).
> >
> > Unfortunately I have no idea how to implement this
> new features in my
> > project because the latest myfaces-release (1.0.7)
> is too old for these
> > updates. Is it possible to grab this features from
> CVS or is there a new
> > myfaces-realease planned for the next days?
> >
> > Best regards,
> > Hendrik Neumann
> 



		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

Re: How to change the layout of the layout component

Posted by Hendrik Neumann <he...@web.de>.
Thank you Manfred. I think I'll write my own renderer and replace the 
"html-table-layout"-solution through div-areas which are positioned by css (I 
think that this is more XHTML-conform).

Am Montag, 13. Dezember 2004 09:42 schrieb Manfred Geiler:
> The <x:panelLayout>-Component is straight-forward and not very
> sophisticated. The rendering is done in one of the hardcoded(!)
> render*-methods in HtmlLayoutRenderer. So you could either extend our
> existing HtmlLayoutRenderer or subclass or replace the
> HtmlLayoutRenderer by your own renderer.

Re: How to change the layout of the layout component

Posted by Manfred Geiler <ma...@apache.org>.
Hendrik,
The <x:panelLayout>-Component is straight-forward and not very 
sophisticated. The rendering is done in one of the hardcoded(!) 
render*-methods in HtmlLayoutRenderer. So you could either extend our 
existing HtmlLayoutRenderer or subclass or replace the 
HtmlLayoutRenderer by your own renderer.

Manfred


Hendrik Neumann wrote:
> Hi everybody,
> 
> I'm currently using your x:panelLayout-Component to structure my Sites. Now I 
> want to implement some special buttons, for example a "supersize"-button 
> which renderes the same jsf-site without the navigation element or a 
> "print"-button which renderes the same site without navigation- and 
> header-elements. But how (and where) can I influence the layout of your 
> x:panelLayout-Component?
> 
>  <x:panelLayout 
>    id="page" 
>    layout="#{userOptions.layout}"
>    styleClass="pageLayout" headerClass="pageHeader"
>    navigationClass="pageNavigation" bodyClass="pageBody"
>    footerClass="pageFooter">
>   
> Greetings,
> Hendrik


How to change the layout of the layout component

Posted by Hendrik Neumann <he...@web.de>.
Hi everybody,

I'm currently using your x:panelLayout-Component to structure my Sites. Now I 
want to implement some special buttons, for example a "supersize"-button 
which renderes the same jsf-site without the navigation element or a 
"print"-button which renderes the same site without navigation- and 
header-elements. But how (and where) can I influence the layout of your 
x:panelLayout-Component?

 <x:panelLayout 
   id="page" 
   layout="#{userOptions.layout}"
   styleClass="pageLayout" headerClass="pageHeader"
   navigationClass="pageNavigation" bodyClass="pageBody"
   footerClass="pageFooter">
  
Greetings,
Hendrik

RE: Wanted: 2 very new features

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Hendrik,

if I understand you right,
you would like to load latest CVS_Version of MyFaces?

See http://www.apache.org/dev/version-control.html
to be able to connect to CVS.

MyFaces is stored under
incubator-myfaces


see our CVS:codebase:
http://cvs.apache.org/viewcvs.cgi/incubator-myfaces/

HTH,
Matthias

> -----Original Message-----
> From: hendrik-neumann@web.de [mailto:hendrik-neumann@web.de] 
> Sent: Saturday, December 04, 2004 6:52 PM
> To: MyFaces Discussion
> Subject: Re: Wanted: 2 very new features
> 
> 
> Isn't there anybody who can help me? Please - I would love to 
> implement these 
> 2 features..
> 
> Am Freitag, 3. Dezember 2004 13:58 schrieb Hendrik Neumann:
> > Hi there,
> >
> > I'm currently developing a "Knowledge and method base for 
> shape memory 
> > alloys" (similar to a CMS) for the Ruhr-University of Bochum (in 
> > Germany) and I'm using JSF-MyFaces for this web-application 
> (thanks a 
> > lot for this great work!).
> >
> > To pursue a strict scheme I'm droolin over 2 very interesting
> > MyFaces-Features: The new WISIWYG-Editor from Sylvain Vieujot ("New 
> > x:htmlEditor", http://kupu.oscom.org/) and the new 
> > tree-component-features from David Le Strat ("[Patch] Added 
> Tree Table 
> > Support to Existing Tree Component.", 
> > http://nagoya.apache.org/jira/browse/MYFACES-8).
> >
> > Unfortunately I have no idea how to implement this new 
> features in my 
> > project because the latest myfaces-release (1.0.7) is too old for 
> > these updates. Is it possible to grab this features from CVS or is 
> > there a new myfaces-realease planned for the next days?
> >
> > Best regards,
> > Hendrik Neumann
> 


Re: Wanted: 2 very new features

Posted by Hendrik Neumann <he...@web.de>.
Isn't there anybody who can help me? Please - I would love to implement these 
2 features..

Am Freitag, 3. Dezember 2004 13:58 schrieb Hendrik Neumann:
> Hi there,
>
> I'm currently developing a "Knowledge and method base for shape memory
> alloys" (similar to a CMS) for the Ruhr-University of Bochum (in Germany)
> and I'm using JSF-MyFaces for this web-application (thanks a lot for this
> great work!).
>
> To pursue a strict scheme I'm droolin over 2 very interesting
> MyFaces-Features: The new WISIWYG-Editor from Sylvain Vieujot ("New
> x:htmlEditor", http://kupu.oscom.org/) and the new tree-component-features
> from David Le Strat ("[Patch] Added Tree Table Support to Existing Tree
> Component.", http://nagoya.apache.org/jira/browse/MYFACES-8).
>
> Unfortunately I have no idea how to implement this new features in my
> project because the latest myfaces-release (1.0.7) is too old for these
> updates. Is it possible to grab this features from CVS or is there a new
> myfaces-realease planned for the next days?
>
> Best regards,
> Hendrik Neumann

Wanted: 2 very new features

Posted by Hendrik Neumann <he...@web.de>.
Hi there,

I'm currently developing a "Knowledge and method base for shape memory 
alloys" (similar to a CMS) for the Ruhr-University of Bochum (in Germany) and 
I'm using JSF-MyFaces for this web-application (thanks a lot for this great 
work!).

To pursue a strict scheme I'm droolin over 2 very interesting 
MyFaces-Features: The new WISIWYG-Editor from Sylvain Vieujot ("New 
x:htmlEditor", http://kupu.oscom.org/) and the new tree-component-features 
from David Le Strat ("[Patch] Added Tree Table Support to Existing Tree 
Component.", http://nagoya.apache.org/jira/browse/MYFACES-8).

Unfortunately I have no idea how to implement this new features in my project 
because the latest myfaces-release (1.0.7) is too old for these updates. Is 
it possible to grab this features from CVS or is there a new myfaces-realease 
planned for the next days?

Best regards,
Hendrik Neumann

populate resultSet

Posted by Francesco Consumi <co...@istitutodeglinnocenti.it>.
Hi people,

I've some doubt about the best way of populating a result set:

<h:dataTable value="#{bean.List}"...../>

I've a dataTable linked to an ArrayList. I populate the array list with result
of a query.
what do you think is the best place to place call to "populate()" method ?
if I put that call in "getList" method of bean, the populate() is being 
called a
lot of times. If I call it once in bean() main procedure, the result is 
not kept
up to date.

thanks,


--
Francesco Consumi
Ufficio Sistemi informativi
Istituto degli Innocenti
Piazza SS.Annunziata, 12
50122 Firenze
consumi at istitutodeglinnocenti.it
Tel. +39 055 2037320
ICQ# 12516133


Re: faces Lifecycle question

Posted by Heath Borders-Wing <he...@gmail.com>.
That's what I've been doing as well.  I don't really feel like its
that big of a deal, though I do wish there was an easy way to just
invalidate the whole session, or re-initialize a bean within the API


On Tue, 23 Nov 2004 10:02:58 -0500, Hycel Taylor <hy...@comcast.net> wrote:
> I too agree that you should, "Remove the variable from the session context
> manually".  I've run into the same issue.  JSF doesn't currently have a good
> lifecycle framework that allows for doing things like reinitializing backing
> beans that are currently in session state.  Here's  what I have been doing
> in instances where I know that I need to reinitialize a backing bean or
> other objects that are currently stored in the session scope.
> 
> I have a Helper class with a few helper methods.  With helper methods, I've
> centralized repetitive code.
> 
> public static final void removeSessionObject(String name) {
>  final FacesContext context = FacesContext.getCurrentInstance();
>  context.getExternalContent().getSessionMap.remove(name);
> }
> 
> As an example, in my PersonAddressListBean class, before calling my person
> address form, to view a specific address, I do the following:
> 
> public String addressLink() {
>   Helper.removeSessionObject(AppConstants.BEAN_PERSON_ADDRESS_LIST);
>   Helper.removeSessionObject(AppConstants.BEAN_PERSON_ADDRESS);
>   final AddressVO address = (AddressVO) getRowData(getForName());
>   Helper.putSessionObject(AppConstants.SESSION_ADDRESS_VO,address);
>   return LINK_ADDRESS;
> }
> 
> I place a new Address value object into session scope.
> 
> I remove the PersonAddress backing bean so that a new one will be
> instantiated and the constructor will be called.  In the constructor of the
> PersonAddress, I retrieve the Address value object.
> 
> I also removed the PersonAddressList backing bean from session scope.  That
> way if I modify, add or delete one or more addresses, PersonAddressList will
> get re-instantiated and refresh its data from the database and show the most
> recent updated list of changes.
> 
> I feel this is crud and adds unnecessary code to my backing beans.  But it's
> the best that I have come up with thus far and it works.
> 
> Hycel
> 
> 
> 
> > Remove the variable from the session context manually.
> >
> >
> > On Tue, 23 Nov 2004 03:15:48 -0800 (PST), No Galz <an...@yahoo.com>
> wrote:
> > > Hii All,
> > >
> > > I m still on my Login issue and i have a wierd problem
> > > with my app. For ex:
> > >
> > > I m using server side state saving, and my app has no
> > > logout feature.
> > >
> > > Problem--> If the user logs in the first time and the
> > > Security filter checks for the authentication, and
> > > forwards to the required page. Next, when the user go
> > > back to the login back..and logs in with incorrect
> > > information...the faces context restores the values
> > > from the old view!!!!! this sucks!!
> > >
> > > In case of login, i don't want the faces context to
> > > apply this restore value phase. Is it possible???
> > >
> > > Regards
> > > fargo
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > The all-new My Yahoo! - Get yours free!
> > > http://my.yahoo.com
> > >
> > >
> >
> >
> > --
> > If you don't have a GMail account, I probably have 5 invites.  Just ask!
> > -Heath Borders-Wing
> > hborders@mail.win.org
> >
> 
> 


-- 
If you don't have a GMail account, I probably have 5 invites.  Just ask!
-Heath Borders-Wing
hborders@mail.win.org

Re: faces Lifecycle question

Posted by Hycel Taylor <hy...@comcast.net>.
I too agree that you should, "Remove the variable from the session context
manually".  I've run into the same issue.  JSF doesn't currently have a good
lifecycle framework that allows for doing things like reinitializing backing
beans that are currently in session state.  Here's  what I have been doing
in instances where I know that I need to reinitialize a backing bean or
other objects that are currently stored in the session scope.

I have a Helper class with a few helper methods.  With helper methods, I've
centralized repetitive code.

public static final void removeSessionObject(String name) {
  final FacesContext context = FacesContext.getCurrentInstance();
  context.getExternalContent().getSessionMap.remove(name);
}

As an example, in my PersonAddressListBean class, before calling my person
address form, to view a specific address, I do the following:

public String addressLink() {
   Helper.removeSessionObject(AppConstants.BEAN_PERSON_ADDRESS_LIST);
   Helper.removeSessionObject(AppConstants.BEAN_PERSON_ADDRESS);
   final AddressVO address = (AddressVO) getRowData(getForName());
   Helper.putSessionObject(AppConstants.SESSION_ADDRESS_VO,address);
   return LINK_ADDRESS;
}

I place a new Address value object into session scope.

I remove the PersonAddress backing bean so that a new one will be
instantiated and the constructor will be called.  In the constructor of the
PersonAddress, I retrieve the Address value object.

I also removed the PersonAddressList backing bean from session scope.  That
way if I modify, add or delete one or more addresses, PersonAddressList will
get re-instantiated and refresh its data from the database and show the most
recent updated list of changes.

I feel this is crud and adds unnecessary code to my backing beans.  But it's
the best that I have come up with thus far and it works.

Hycel

> Remove the variable from the session context manually.
>
>
> On Tue, 23 Nov 2004 03:15:48 -0800 (PST), No Galz <an...@yahoo.com>
wrote:
> > Hii All,
> >
> > I m still on my Login issue and i have a wierd problem
> > with my app. For ex:
> >
> > I m using server side state saving, and my app has no
> > logout feature.
> >
> > Problem--> If the user logs in the first time and the
> > Security filter checks for the authentication, and
> > forwards to the required page. Next, when the user go
> > back to the login back..and logs in with incorrect
> > information...the faces context restores the values
> > from the old view!!!!! this sucks!!
> >
> > In case of login, i don't want the faces context to
> > apply this restore value phase. Is it possible???
> >
> > Regards
> > fargo
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > The all-new My Yahoo! - Get yours free!
> > http://my.yahoo.com
> >
> >
>
>
> -- 
> If you don't have a GMail account, I probably have 5 invites.  Just ask!
> -Heath Borders-Wing
> hborders@mail.win.org
>


Re: faces Lifecycle question

Posted by Heath Borders-Wing <he...@gmail.com>.
Remove the variable from the session context manually.


On Tue, 23 Nov 2004 03:15:48 -0800 (PST), No Galz <an...@yahoo.com> wrote:
> Hii All,
> 
> I m still on my Login issue and i have a wierd problem
> with my app. For ex:
> 
> I m using server side state saving, and my app has no
> logout feature.
> 
> Problem--> If the user logs in the first time and the
> Security filter checks for the authentication, and
> forwards to the required page. Next, when the user go
> back to the login back..and logs in with incorrect
> information...the faces context restores the values
> from the old view!!!!! this sucks!!
> 
> In case of login, i don't want the faces context to
> apply this restore value phase. Is it possible???
> 
> Regards
> fargo
> 
> 
> __________________________________
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
> http://my.yahoo.com
> 
> 


-- 
If you don't have a GMail account, I probably have 5 invites.  Just ask!
-Heath Borders-Wing
hborders@mail.win.org

faces Lifecycle question

Posted by No Galz <an...@yahoo.com>.
Hii All,

I m still on my Login issue and i have a wierd problem
with my app. For ex:

I m using server side state saving, and my app has no
logout feature.

Problem--> If the user logs in the first time and the
Security filter checks for the authentication, and
forwards to the required page. Next, when the user go
back to the login back..and logs in with incorrect
information...the faces context restores the values
from the old view!!!!! this sucks!! 

In case of login, i don't want the faces context to
apply this restore value phase. Is it possible???

Regards
fargo





		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


RE: Struts and my faces

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
hey fargo,

well filter should work fine in faces.
myfaces uses a filter and Shale (proposal for Struts2)
is using filter too.

I didn't looked detailed at Shale, which uses
JSF in View-Tier.

So no idea for now.

Could you do a bit debuging on that?
(why it came up to that exception)

Thanks,
Matthias

> -----Original Message-----
> From: No Galz [mailto:anshulpatni@yahoo.com] 
> Sent: Monday, November 22, 2004 1:58 PM
> To: MyFaces Discussion
> Subject: RE: Struts and my faces
> 
> 
> Hii Matthias,
> 
> Thanks for your quick update. Actually, i just want to
> add something to the present thread. 
> 
> I see the HttpServletRequestWrapper already available
> at org.apache.struts.faces.util package. So, this
> should not be the issue.
> 
> Moreover, in my application i have a
> ActionFilter..which actually do the authentication on
> page basis. I have a mapping for this action filter as
> 
> 
> <filter-mapping>
> 	<filter-name>ActionFilter</filter-name>
>     <url-pattern>*.do</url-pattern>
> </filter-mapping>
> 
> So, this may be a cause of problem. What do u think
> about it??? Is Filter and Faces go fine together?? I
> heard a lot of fuss about it.
> 
> Thanks for your update.
> Regards,
> fargo
> 
> 
> --- Matthias Wessendorf
> <ma...@matthias-wessendorf.de> wrote:
> 
> > mmm,
> > strange. I wrote a HttpRequestWrapper, that is
> > included
> > in Struts-Faces. That guy worked. After that I
> > didn't
> > used to combine Struts and Faces.
> > 
> > Could you use our last CVS_HEAD
> > (from apache-site)
> > 
> > and last struts-faces CVS_HEAD?
> > 
> > Thanks,
> > Matthias
> > 
> > > -----Original Message-----
> > > From: No Galz [mailto:anshulpatni@yahoo.com]
> > > Sent: Monday, November 22, 2004 1:45 PM
> > > To: MyFaces Discussion
> > > Subject: RE: Struts and my faces
> > > 
> > > 
> > > Hii Matthias,
> > > 
> > > I tried as u mentioned and i m trying to keep my
> > old
> > > struts app as intact and just wanted to use the
> > > myfaces components. But i got the following
> > problem
> > > 
> > > Category:
> >
> net.sourceforge.myfaces.application.jsp.JspViewHandler
> > > 
> > > could not find pathMapping for servletPath =
> > > /loginAuth.do requestPathInfo = null
> > > 
> > > as i read in a maling list, the issue raised by
> > you..
> > > 
> > >
> >
> http://www.mail-archive.com/dev@struts.apache.org/msg01926.html
> > > 
> > > Is this not included still in struts-faces lib.
> > Can
> > > you just update on this issue.
> > > 
> > > thanks for your advice.
> > > regards
> > > fargo
> > > 
> > > 
> > > --- Matthias Wessendorf
> > > <ma...@matthias-wessendorf.de> wrote:
> > > 
> > > > Fargo,
> > > > 
> > > > thanks for your interesst in MyFaces.
> > > > 
> > > > A while ago, I tested MyFaces and Struts-Faces
> > > > from Apache Struts. It works.
> > > > 
> > > > What todo:
> > > > -struts-config: add Faces/TilesFaces -
> > > > RequestProcessor
> > > > -web.xml: add MyFaces' ContextListener
> > > > -use <s:form action="/myAction"/>-Custom-JSF-Tag
> > for
> > > > using
> > > > JSF-components with FormBeans and Actions
> > > >  inside of <s:form/> nest a <h:commandButton value="GO!"/>
> > > > 
> > > > you need not to *update* all pages. go step by
> > step.
> > > > (and play a bit with the new Tags)
> > > > 
> > > > BTW. Struts-Faces is designed to work with *any* JSF-Impl.
> > > > since Struts-Faces only uses JSF-API, and not a
> > > > specific API
> > > > like MyFaces or the RI from SUN.
> > > > 
> > > > HTH,
> > > > Matthias
> > > > 
> > > > 
> > > > > -----Original Message-----
> > > > > From: No Galz [mailto:anshulpatni@yahoo.com]
> > > > > Sent: Friday, November 19, 2004 1:04 PM
> > > > > To: MyFaces Discussion
> > > > > Subject: Struts and my faces
> > > > > 
> > > > > 
> > > > > Hello myfaces users,
> > > > > 
> > > > > I need an advice. I have a big application
> > which
> > > > is
> > > > > completely struts based. But i would like to
> > use
> > > > the
> > > > > JSF components (myfaces imple.) with my
> > present
> > > > struts
> > > > > based app.
> > > > > 
> > > > > Question) Is it possible to integrate the
> > > > JSF+Struts
> > > > > with myfaves impl. using the JSF+Struts
> > > > integration
> > > > > library??
> > > > > 
> > > > > Thanks in advance.
> > > > > 
> > > > > Regards
> > > > > fargo
> > > > > 
> > > > > 
> > > > > 		
> > > > > __________________________________
> > > > > Do you Yahoo!?
> > > > > The all-new My Yahoo! - Get yours free! 
> > > > > http://my.yahoo.com 
> > > > >  
> > > > > 
> > > > 
> > > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


RE: Struts and my faces

Posted by No Galz <an...@yahoo.com>.
Hii Matthias,

Thanks for your quick update. Actually, i just want to
add something to the present thread. 

I see the HttpServletRequestWrapper already available
at org.apache.struts.faces.util package. So, this
should not be the issue.

Moreover, in my application i have a
ActionFilter..which actually do the authentication on
page basis. I have a mapping for this action filter as


<filter-mapping>
	<filter-name>ActionFilter</filter-name>
    <url-pattern>*.do</url-pattern>
</filter-mapping>

So, this may be a cause of problem. What do u think
about it??? Is Filter and Faces go fine together?? I
heard a lot of fuss about it.

Thanks for your update.
Regards,
fargo


--- Matthias Wessendorf
<ma...@matthias-wessendorf.de> wrote:

> mmm,
> strange. I wrote a HttpRequestWrapper, that is
> included
> in Struts-Faces. That guy worked. After that I
> didn't
> used to combine Struts and Faces.
> 
> Could you use our last CVS_HEAD
> (from apache-site)
> 
> and last struts-faces CVS_HEAD?
> 
> Thanks,
> Matthias
> 
> > -----Original Message-----
> > From: No Galz [mailto:anshulpatni@yahoo.com] 
> > Sent: Monday, November 22, 2004 1:45 PM
> > To: MyFaces Discussion
> > Subject: RE: Struts and my faces
> > 
> > 
> > Hii Matthias,
> > 
> > I tried as u mentioned and i m trying to keep my
> old
> > struts app as intact and just wanted to use the
> > myfaces components. But i got the following
> problem
> > 
> > Category:
>
net.sourceforge.myfaces.application.jsp.JspViewHandler
> > 
> > could not find pathMapping for servletPath =
> > /loginAuth.do requestPathInfo = null
> > 
> > as i read in a maling list, the issue raised by
> you..
> > 
> >
>
http://www.mail-archive.com/dev@struts.apache.org/msg01926.html
> > 
> > Is this not included still in struts-faces lib.
> Can
> > you just update on this issue.
> > 
> > thanks for your advice.
> > regards
> > fargo
> > 
> > 
> > --- Matthias Wessendorf
> > <ma...@matthias-wessendorf.de> wrote:
> > 
> > > Fargo,
> > > 
> > > thanks for your interesst in MyFaces.
> > > 
> > > A while ago, I tested MyFaces and Struts-Faces
> > > from Apache Struts. It works.
> > > 
> > > What todo:
> > > -struts-config: add Faces/TilesFaces -
> > > RequestProcessor
> > > -web.xml: add MyFaces' ContextListener
> > > -use <s:form action="/myAction"/>-Custom-JSF-Tag
> for
> > > using
> > > JSF-components with FormBeans and Actions
> > >  inside of <s:form/> nest a <h:commandButton
> > > value="GO!"/>
> > > 
> > > you need not to *update* all pages. go step by
> step.
> > > (and play a bit with the new Tags)
> > > 
> > > BTW. Struts-Faces is designed to work with *any*
> > > JSF-Impl.
> > > since Struts-Faces only uses JSF-API, and not a
> > > specific API
> > > like MyFaces or the RI from SUN.
> > > 
> > > HTH,
> > > Matthias
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: No Galz [mailto:anshulpatni@yahoo.com]
> > > > Sent: Friday, November 19, 2004 1:04 PM
> > > > To: MyFaces Discussion
> > > > Subject: Struts and my faces
> > > > 
> > > > 
> > > > Hello myfaces users,
> > > > 
> > > > I need an advice. I have a big application
> which
> > > is
> > > > completely struts based. But i would like to
> use
> > > the
> > > > JSF components (myfaces imple.) with my
> present
> > > struts
> > > > based app.
> > > > 
> > > > Question) Is it possible to integrate the
> > > JSF+Struts
> > > > with myfaves impl. using the JSF+Struts
> > > integration
> > > > library??
> > > > 
> > > > Thanks in advance.
> > > > 
> > > > Regards
> > > > fargo
> > > > 
> > > > 
> > > > 		
> > > > __________________________________
> > > > Do you Yahoo!? 
> > > > The all-new My Yahoo! - Get yours free! 
> > > > http://my.yahoo.com 
> > > >  
> > > > 
> > > 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

RE: Struts and my faces

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
mmm,
strange. I wrote a HttpRequestWrapper, that is included
in Struts-Faces. That guy worked. After that I didn't
used to combine Struts and Faces.

Could you use our last CVS_HEAD
(from apache-site)

and last struts-faces CVS_HEAD?

Thanks,
Matthias

> -----Original Message-----
> From: No Galz [mailto:anshulpatni@yahoo.com] 
> Sent: Monday, November 22, 2004 1:45 PM
> To: MyFaces Discussion
> Subject: RE: Struts and my faces
> 
> 
> Hii Matthias,
> 
> I tried as u mentioned and i m trying to keep my old
> struts app as intact and just wanted to use the
> myfaces components. But i got the following problem
> 
> Category: net.sourceforge.myfaces.application.jsp.JspViewHandler
> 
> could not find pathMapping for servletPath =
> /loginAuth.do requestPathInfo = null
> 
> as i read in a maling list, the issue raised by you..
> 
> http://www.mail-archive.com/dev@struts.apache.org/msg01926.html
> 
> Is this not included still in struts-faces lib. Can
> you just update on this issue.
> 
> thanks for your advice.
> regards
> fargo
> 
> 
> --- Matthias Wessendorf
> <ma...@matthias-wessendorf.de> wrote:
> 
> > Fargo,
> > 
> > thanks for your interesst in MyFaces.
> > 
> > A while ago, I tested MyFaces and Struts-Faces
> > from Apache Struts. It works.
> > 
> > What todo:
> > -struts-config: add Faces/TilesFaces -
> > RequestProcessor
> > -web.xml: add MyFaces' ContextListener
> > -use <s:form action="/myAction"/>-Custom-JSF-Tag for
> > using
> > JSF-components with FormBeans and Actions
> >  inside of <s:form/> nest a <h:commandButton
> > value="GO!"/>
> > 
> > you need not to *update* all pages. go step by step.
> > (and play a bit with the new Tags)
> > 
> > BTW. Struts-Faces is designed to work with *any*
> > JSF-Impl.
> > since Struts-Faces only uses JSF-API, and not a
> > specific API
> > like MyFaces or the RI from SUN.
> > 
> > HTH,
> > Matthias
> > 
> > 
> > > -----Original Message-----
> > > From: No Galz [mailto:anshulpatni@yahoo.com]
> > > Sent: Friday, November 19, 2004 1:04 PM
> > > To: MyFaces Discussion
> > > Subject: Struts and my faces
> > > 
> > > 
> > > Hello myfaces users,
> > > 
> > > I need an advice. I have a big application which
> > is
> > > completely struts based. But i would like to use
> > the
> > > JSF components (myfaces imple.) with my present
> > struts
> > > based app.
> > > 
> > > Question) Is it possible to integrate the
> > JSF+Struts
> > > with myfaves impl. using the JSF+Struts
> > integration
> > > library??
> > > 
> > > Thanks in advance.
> > > 
> > > Regards
> > > fargo
> > > 
> > > 
> > > 		
> > > __________________________________
> > > Do you Yahoo!? 
> > > The all-new My Yahoo! - Get yours free! 
> > > http://my.yahoo.com 
> > >  
> > > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


RE: Struts and my faces

Posted by No Galz <an...@yahoo.com>.
Hii Matthias,

I tried as u mentioned and i m trying to keep my old
struts app as intact and just wanted to use the
myfaces components. But i got the following problem

Category:
net.sourceforge.myfaces.application.jsp.JspViewHandler

could not find pathMapping for servletPath =
/loginAuth.do requestPathInfo = null

as i read in a maling list, the issue raised by you..

http://www.mail-archive.com/dev@struts.apache.org/msg01926.html

Is this not included still in struts-faces lib. Can
you just update on this issue.

thanks for your advice.
regards
fargo


--- Matthias Wessendorf
<ma...@matthias-wessendorf.de> wrote:

> Fargo,
> 
> thanks for your interesst in MyFaces.
> 
> A while ago, I tested MyFaces and Struts-Faces
> from Apache Struts. It works.
> 
> What todo:
> -struts-config: add Faces/TilesFaces -
> RequestProcessor
> -web.xml: add MyFaces' ContextListener
> -use <s:form action="/myAction"/>-Custom-JSF-Tag for
> using
> JSF-components with FormBeans and Actions
>  inside of <s:form/> nest a <h:commandButton
> value="GO!"/>
> 
> you need not to *update* all pages. go step by step.
> (and play a bit with the new Tags)
> 
> BTW. Struts-Faces is designed to work with *any*
> JSF-Impl.
> since Struts-Faces only uses JSF-API, and not a
> specific API
> like MyFaces or the RI from SUN.
> 
> HTH,
> Matthias
> 
> 
> > -----Original Message-----
> > From: No Galz [mailto:anshulpatni@yahoo.com] 
> > Sent: Friday, November 19, 2004 1:04 PM
> > To: MyFaces Discussion
> > Subject: Struts and my faces
> > 
> > 
> > Hello myfaces users,
> > 
> > I need an advice. I have a big application which
> is
> > completely struts based. But i would like to use
> the
> > JSF components (myfaces imple.) with my present
> struts
> > based app. 
> > 
> > Question) Is it possible to integrate the
> JSF+Struts
> > with myfaves impl. using the JSF+Struts
> integration
> > library??
> > 
> > Thanks in advance.
> > 
> > Regards
> > fargo
> > 
> > 
> > 		
> > __________________________________ 
> > Do you Yahoo!? 
> > The all-new My Yahoo! - Get yours free! 
> > http://my.yahoo.com 
> >  
> > 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

RE: Struts and my faces

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Fargo,

thanks for your interesst in MyFaces.

A while ago, I tested MyFaces and Struts-Faces
from Apache Struts. It works.

What todo:
-struts-config: add Faces/TilesFaces - RequestProcessor
-web.xml: add MyFaces' ContextListener
-use <s:form action="/myAction"/>-Custom-JSF-Tag for using
JSF-components with FormBeans and Actions
 inside of <s:form/> nest a <h:commandButton value="GO!"/>

you need not to *update* all pages. go step by step.
(and play a bit with the new Tags)

BTW. Struts-Faces is designed to work with *any* JSF-Impl.
since Struts-Faces only uses JSF-API, and not a specific API
like MyFaces or the RI from SUN.

HTH,
Matthias


> -----Original Message-----
> From: No Galz [mailto:anshulpatni@yahoo.com] 
> Sent: Friday, November 19, 2004 1:04 PM
> To: MyFaces Discussion
> Subject: Struts and my faces
> 
> 
> Hello myfaces users,
> 
> I need an advice. I have a big application which is
> completely struts based. But i would like to use the
> JSF components (myfaces imple.) with my present struts
> based app. 
> 
> Question) Is it possible to integrate the JSF+Struts
> with myfaves impl. using the JSF+Struts integration
> library??
> 
> Thanks in advance.
> 
> Regards
> fargo
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> The all-new My Yahoo! - Get yours free! 
> http://my.yahoo.com 
>  
>