You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joe Hertz <jh...@patriot.net> on 2004/04/09 04:42:31 UTC

DynaBeans with struts faces [Was Right Back in My Struts Face]

James-

Thank you. I had already grabbed faces-console, but many of those links 
actually had (more) current examples. Still there's nothing explicit that 
would make one realize f:view replaced f:use_faces, but I figured it out.

Is there anything special I need to do to use a struts-config defined 
DynaBean inside of JSF? The struts-faces examples have one dynabean declared, 
but if you look in the corresponding class, it turns out not to be a DynaBean 
after all (story of my life).

The following snippet bombs, claiming it can't find the items property of 
MaintenanceListForm, which is definitely there in the struts-config.

TIA

-Joe

<c:forEach var="item" items="${MaintenanceListForm.items}">
<tr><td><h:inputHidden id="item.id" value="${item.id}"/>
<h:inputText id="item.creditCost" size="5" maxlength="5" value="#
{item.creditCost}"/>
</td>
<td><h:inputText id="item.minPurchase" size="6" maxlength="6" value="#
{item.minPurchase}"/>
</td>
<td><h:selectOneListbox id="item.currency">
  <f:selectItem itemValue="USD" />
  <f:selectItem itemValue="CAD" />
  <f:selectItem itemValue="EUR" />
  <f:selectItem itemValue="JPY" />
  </h:selectOneListbox>
</td>
<td><h:inputText id="item.beginDate" value="${item.beginDate}"/> </td>
<td><h:inputText id="item.endDate" value="${item.endDate}" /></td></tr>
</c:forEach>



> -----Original Message-----
> From: James Holmes [mailto:james@jamesholmes.com] 
> Sent: Thursday, April 08, 2004 8:42 AM
> To: Struts Users Mailing List
> Subject: Re: [OT-rant] Right Back in My Struts Face
> 
> 
> Joe,
> 
> My guess is that you are trying to make a pre-1.0 example 
> work with the 1.0 Final release of JSF.  In most scenarios, 
> that will not work because there have been significant 
> changes to JSF throughout its release cycle. 
> I would suggest trying out another example application 
> instead of the one you're working with.  You can find several 
> tutorials on my websiate at:
> 
> http://www.jamesholmes.com/JavaServerFaces/
> 
> You may also want to try posting issues like this to the JSF forum:
> 
> http://forum.java.sun.com/forum.jsp?forum=427
> 
> Hope that helps,
> 
> James
> http://www.jamesholmes.com/
> 
> >
> >
> > I picked up JSF today, never having touched JSF in the first place.
> >
> > So far, struts faces seems fine, but as far as the JSF1.0 Reference 
> > goes, I am...well..it's easier to show you.
> >
> > My experience went something like this.
> >
> > Jasper can't find the <f:use_faces> tag. Hmmm. This is kind of a 
> > critical thing, so I'm lead to believe. Try to find what I 
> did wrong. 
> > No joy. Googling doesn't mention this gotcha. Neither does the 
> > Kurniawan book on JSF. Release
> > notes don't mention it. Must not be finding the taglibs??? 
> Nope. Maybe
> > they
> > camelized it like some of the other tags and forgot to say 
> so? Nope. After
> > double and triple checking myself, I look into the taglibs 
> themselves.
> > Whoa --
> >  It's really not there! Hoookay...so I check the struts 
> faces examples.
> > and
> > sure enough, it is not used there either. Must be gone... 
> Failing that, if
> > Craig doesn't need it, neither do I. Huzzah...I think. So I 
> crib off of
> > the
> > examples. Obviously the docs aint current at all...I 
> think/hope/wonder.
> >
> > Then I find a number of tags have changed ever so slightly, 
> but that I 
> > had found in the release note
> > 
> (http://java.sun.com/j2ee/javaserverfaces/docs/ReleaseNotes.ht
ml) even 
> though the link to the README file is 404.
>
> So, with my newly found faith in the release notes and book I bought, 
> I continue using "the braille system" to get a compile. Lo, more 
> discoveries. Am I to understand that <h:input_date> ^H^H^H^H^H 
> inputDate> is gone too????
> As is <h:input_n^H^HNumber>?? I kinda thought they were the point here...
> Guess I have to use <h:input_text> and use a converter?? I guess. Maybe.
> Or
> do I? No amount of googling is providing me an answer about this either,
> and
> this time the best source of documentation I have (the struts faces
> examples)
> don't have a case where non-text input it gathered from the user.
>
> I'm not as annoyed as I sound (not much anyway), but it's quite 
> frustrating to have this happen when you really did RTFM -- Lots of 
> them.
>
> Watch it turn out to all be documented some place obvious I didn't 
> think to look...
>
> -Joe
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: DynaBeans with struts faces [Was Right Back in My Struts Face]

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

the thing with <f:view> was noticed in the "online" release-notes
that where shiped with the beta.(not more online, i guess) In
Early_Access_X there where the <f:use_faces>-Tag.
however, you must add the following to struts-cfg.xml:
<controller>
  <set-property property="inputForward" value="true"/>
  <set-property property="processorClass"
 
value="org.apache.struts.faces.application.FacesTilesRequestProcessor"/>
</controller>
note, i use the tiles-candidate for supporting tiles in my
jsf-sturts-apps
there is also a FacesRequestProcessor-class

the dynaBeans are supported via struts-faces.jar.
The class "PropertyResolverImpl" decorates the default PropertyResolver
shiped with implementation you use : RI, MyFAces,...
(decorator-pattern //Gamma//)

the value of field 'id' has the restrictions:
-Must not be a zero-length String
-First character must be a letter or an underscore ('_')
-Subsequent characters must be a letter, a digit, an underscore ('_'),
or a dash ('-')

so no dot ('.')

and use #{} instead of ${}


hope that helps you.

:)
Cheers,
Matthias




-----Original Message-----
From: Joe Hertz [mailto:jhertz@patriot.net] 
Sent: Friday, April 09, 2004 4:43 AM
To: struts-user@jakarta.apache.org
Subject: DynaBeans with struts faces [Was Right Back in My Struts Face]


James-

Thank you. I had already grabbed faces-console, but many of those links 
actually had (more) current examples. Still there's nothing explicit
that 
would make one realize f:view replaced f:use_faces, but I figured it
out.

Is there anything special I need to do to use a struts-config defined 
DynaBean inside of JSF? The struts-faces examples have one dynabean
declared, 
but if you look in the corresponding class, it turns out not to be a
DynaBean 
after all (story of my life).

The following snippet bombs, claiming it can't find the items property
of 
MaintenanceListForm, which is definitely there in the struts-config.

TIA

-Joe

<c:forEach var="item" items="${MaintenanceListForm.items}">
<tr><td><h:inputHidden id="item.id" value="${item.id}"/> <h:inputText
id="item.creditCost" size="5" maxlength="5" value="#
{item.creditCost}"/> </td> <td><h:inputText id="item.minPurchase"
size="6" maxlength="6" value="# {item.minPurchase}"/> </td>
<td><h:selectOneListbox id="item.currency">
  <f:selectItem itemValue="USD" />
  <f:selectItem itemValue="CAD" />
  <f:selectItem itemValue="EUR" />
  <f:selectItem itemValue="JPY" />
  </h:selectOneListbox>
</td>
<td><h:inputText id="item.beginDate" value="${item.beginDate}"/> </td>
<td><h:inputText id="item.endDate" value="${item.endDate}" /></td></tr>
</c:forEach>



> -----Original Message-----
> From: James Holmes [mailto:james@jamesholmes.com]
> Sent: Thursday, April 08, 2004 8:42 AM
> To: Struts Users Mailing List
> Subject: Re: [OT-rant] Right Back in My Struts Face
> 
> 
> Joe,
> 
> My guess is that you are trying to make a pre-1.0 example
> work with the 1.0 Final release of JSF.  In most scenarios, 
> that will not work because there have been significant 
> changes to JSF throughout its release cycle. 
> I would suggest trying out another example application 
> instead of the one you're working with.  You can find several 
> tutorials on my websiate at:
> 
> http://www.jamesholmes.com/JavaServerFaces/
> 
> You may also want to try posting issues like this to the JSF forum:
> 
> http://forum.java.sun.com/forum.jsp?forum=427
> 
> Hope that helps,
> 
> James
> http://www.jamesholmes.com/
> 
> >
> >
> > I picked up JSF today, never having touched JSF in the first place.
> >
> > So far, struts faces seems fine, but as far as the JSF1.0 Reference
> > goes, I am...well..it's easier to show you.
> >
> > My experience went something like this.
> >
> > Jasper can't find the <f:use_faces> tag. Hmmm. This is kind of a
> > critical thing, so I'm lead to believe. Try to find what I 
> did wrong.
> > No joy. Googling doesn't mention this gotcha. Neither does the
> > Kurniawan book on JSF. Release
> > notes don't mention it. Must not be finding the taglibs??? 
> Nope. Maybe
> > they
> > camelized it like some of the other tags and forgot to say
> so? Nope. After
> > double and triple checking myself, I look into the taglibs
> themselves.
> > Whoa --
> >  It's really not there! Hoookay...so I check the struts
> faces examples.
> > and
> > sure enough, it is not used there either. Must be gone...
> Failing that, if
> > Craig doesn't need it, neither do I. Huzzah...I think. So I
> crib off of
> > the
> > examples. Obviously the docs aint current at all...I
> think/hope/wonder.
> >
> > Then I find a number of tags have changed ever so slightly,
> but that I
> > had found in the release note
> > 
> (http://java.sun.com/j2ee/javaserverfaces/docs/ReleaseNotes.ht
ml) even 
> though the link to the README file is 404.
>
> So, with my newly found faith in the release notes and book I bought,
> I continue using "the braille system" to get a compile. Lo, more 
> discoveries. Am I to understand that <h:input_date> ^H^H^H^H^H 
> inputDate> is gone too????
> As is <h:input_n^H^HNumber>?? I kinda thought they were the point 
> here... Guess I have to use <h:input_text> and use a converter?? I 
> guess. Maybe. Or do I? No amount of googling is providing me an answer

> about this either, and
> this time the best source of documentation I have (the struts faces
> examples)
> don't have a case where non-text input it gathered from the user.
>
> I'm not as annoyed as I sound (not much anyway), but it's quite
> frustrating to have this happen when you really did RTFM -- Lots of 
> them.
>
> Watch it turn out to all be documented some place obvious I didn't
> think to look...
>
> -Joe
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: DynaBeans with struts faces [Was Right Back in My Struts Face]

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

the thing with <f:view> was noticed in the "online" release-notes
that where shiped with the beta.(not more online, i guess) In
Early_Access_X there where the <f:use_faces>-Tag.
however, you must add the following to struts-cfg.xml:
<controller>
  <set-property property="inputForward" value="true"/>
  <set-property property="processorClass"
 
value="org.apache.struts.faces.application.FacesTilesRequestProcessor"/>
</controller>
note, i use the tiles-candidate for supporting tiles in my
jsf-sturts-apps
there is also a FacesRequestProcessor-class

the dynaBeans are supported via struts-faces.jar.
The class "PropertyResolverImpl" decorates the default PropertyResolver
shiped with implementation you use : RI, MyFAces,...
(decorator-pattern //Gamma//)

the value of field 'id' has the restrictions:
-Must not be a zero-length String
-First character must be a letter or an underscore ('_')
-Subsequent characters must be a letter, a digit, an underscore ('_'),
or a dash ('-')

so no dot ('.')

and use #{} instead of ${}


hope that helps you.

:)
Cheers,
Matthias



-----Original Message-----
From: Joe Hertz [mailto:jhertz@patriot.net] 
Sent: Friday, April 09, 2004 4:43 AM
To: struts-user@jakarta.apache.org
Subject: DynaBeans with struts faces [Was Right Back in My Struts Face]


James-

Thank you. I had already grabbed faces-console, but many of those links 
actually had (more) current examples. Still there's nothing explicit
that 
would make one realize f:view replaced f:use_faces, but I figured it
out.

Is there anything special I need to do to use a struts-config defined 
DynaBean inside of JSF? The struts-faces examples have one dynabean
declared, 
but if you look in the corresponding class, it turns out not to be a
DynaBean 
after all (story of my life).

The following snippet bombs, claiming it can't find the items property
of 
MaintenanceListForm, which is definitely there in the struts-config.

TIA

-Joe

<c:forEach var="item" items="${MaintenanceListForm.items}">
<tr><td><h:inputHidden id="item.id" value="${item.id}"/> <h:inputText
id="item.creditCost" size="5" maxlength="5" value="#
{item.creditCost}"/> </td> <td><h:inputText id="item.minPurchase"
size="6" maxlength="6" value="# {item.minPurchase}"/> </td>
<td><h:selectOneListbox id="item.currency">
  <f:selectItem itemValue="USD" />
  <f:selectItem itemValue="CAD" />
  <f:selectItem itemValue="EUR" />
  <f:selectItem itemValue="JPY" />
  </h:selectOneListbox>
</td>
<td><h:inputText id="item.beginDate" value="${item.beginDate}"/> </td>
<td><h:inputText id="item.endDate" value="${item.endDate}" /></td></tr>
</c:forEach>



> -----Original Message-----
> From: James Holmes [mailto:james@jamesholmes.com]
> Sent: Thursday, April 08, 2004 8:42 AM
> To: Struts Users Mailing List
> Subject: Re: [OT-rant] Right Back in My Struts Face
> 
> 
> Joe,
> 
> My guess is that you are trying to make a pre-1.0 example
> work with the 1.0 Final release of JSF.  In most scenarios, 
> that will not work because there have been significant 
> changes to JSF throughout its release cycle. 
> I would suggest trying out another example application 
> instead of the one you're working with.  You can find several 
> tutorials on my websiate at:
> 
> http://www.jamesholmes.com/JavaServerFaces/
> 
> You may also want to try posting issues like this to the JSF forum:
> 
> http://forum.java.sun.com/forum.jsp?forum=427
> 
> Hope that helps,
> 
> James
> http://www.jamesholmes.com/
> 
> >
> >
> > I picked up JSF today, never having touched JSF in the first place.
> >
> > So far, struts faces seems fine, but as far as the JSF1.0 Reference
> > goes, I am...well..it's easier to show you.
> >
> > My experience went something like this.
> >
> > Jasper can't find the <f:use_faces> tag. Hmmm. This is kind of a
> > critical thing, so I'm lead to believe. Try to find what I 
> did wrong.
> > No joy. Googling doesn't mention this gotcha. Neither does the
> > Kurniawan book on JSF. Release
> > notes don't mention it. Must not be finding the taglibs??? 
> Nope. Maybe
> > they
> > camelized it like some of the other tags and forgot to say
> so? Nope. After
> > double and triple checking myself, I look into the taglibs
> themselves.
> > Whoa --
> >  It's really not there! Hoookay...so I check the struts
> faces examples.
> > and
> > sure enough, it is not used there either. Must be gone...
> Failing that, if
> > Craig doesn't need it, neither do I. Huzzah...I think. So I
> crib off of
> > the
> > examples. Obviously the docs aint current at all...I
> think/hope/wonder.
> >
> > Then I find a number of tags have changed ever so slightly,
> but that I
> > had found in the release note
> > 
> (http://java.sun.com/j2ee/javaserverfaces/docs/ReleaseNotes.ht
ml) even 
> though the link to the README file is 404.
>
> So, with my newly found faith in the release notes and book I bought,
> I continue using "the braille system" to get a compile. Lo, more 
> discoveries. Am I to understand that <h:input_date> ^H^H^H^H^H 
> inputDate> is gone too????
> As is <h:input_n^H^HNumber>?? I kinda thought they were the point 
> here... Guess I have to use <h:input_text> and use a converter?? I 
> guess. Maybe. Or do I? No amount of googling is providing me an answer

> about this either, and
> this time the best source of documentation I have (the struts faces
> examples)
> don't have a case where non-text input it gathered from the user.
>
> I'm not as annoyed as I sound (not much anyway), but it's quite
> frustrating to have this happen when you really did RTFM -- Lots of 
> them.
>
> Watch it turn out to all be documented some place obvious I didn't
> think to look...
>
> -Joe
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org