myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above
Date Wed, 24 Oct 2012 11:14:55 GMT
Gerhard,

Interesting response and this is good to know.

Stephen,

Yes, it's me Howard (smithh032772) from PrimeFaces Core community forum. I
fully recommend Gerhard's suggestion. *Prior* to migrating from Mojarra
2.1.7 to MyFaces 2.1.8, I had ui:include issues and had to customize or
tailor the PARTIAL_STATE_SAVING to true, server, and to index.xhtml, which
is the parent xhtml page that contains any/all other children xhtml pages
via ui:include src="#{bean.page}". Also, please note that I had all JSF
ViewScoped (non-CODI) beans except for UsersController and
PageNavigationController beans where were JSF SessionScoped.

I'm sure you are aware of BalusC (on stackoverflow.com), I learned from his
posts and/or blogs that ViewScoped beans had issues with partial state
saving and ui:include, and I experienced all that, but I managed to get
things working while using Mojarra with the configuration I mentioned in
the previous paragraph.

Also, immediately prior to migrating from Mojarra 2.1.7 to MyFaces 2.1.8, I
heard time-and-time-again of other expert JSF developers to 'try' MyFaces
where Mojarra may fail on AJAX updates/rendering, so I tried MyFaces 2.1.8,
after hearing that MyFaces 2.1.7+ has great performance with (AJAX) page
rendering over Mojarra.

After migrating from Mojarra 2.1.7 to MyFaces 2.1.8, I decided to change
all my beans from ViewScoped to SessionScoped, because of errors/issues I
had migrating from Mojarra 2.1.7 to MyFaces 2.1.8 (I recently saw that
MyFaces 2.1.9 might have fixed that issue, something to do with EJB
injection, if I'm not mistaking).

Anyway, after telling you all of this (above), my web.xml has the following
as I am now the happy and satisfied user of MyFaces 2.1.9 (and previously
and initially, MyFaces 2.1.8):

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
        <param-value>true</param-value>
    </context-param>
<!--
 * 2012-08-18 commented context-param below since migrated ViewScoped to
SessionScoped beans
    <context-param>
        <param-name>javax.faces.FULL_STATE_SAVING_VIEW_IDS</param-name>
        <param-value>/index.xhtml</param-value>
    </context-param>
-->
<!--
 * http://myfaces.apache.org/core20/myfaces-impl/webconfig.html
 * http://wiki.apache.org/myfaces/Performance
 *
 * Per default settings, Mojarra does not serialize beans in the session.
 * MyFaces serialize it per default. You can also disable it in MyFaces
 * but i recommand to make all the stuff serializable because it would be
 * required if you would like to use session replication and clustering for
example.
 * http://forum.primefaces.org/viewtopic.php?f=3&t=24157&start=10#p75383
-->



Howard


On Wed, Oct 24, 2012 at 7:00 AM, Stephen More <stephen.more@gmail.com>wrote:

> In my notes that was required because of a JSF 2.0 include bug I ran
> into. I will have to research the original ui:include bug, and turn
> this back to true to see if that bug comes back.
>
> -Thanks
> Stephen More
>
>
> On Wed, Oct 24, 2012 at 3:54 AM, Gerhard Petracek
> <gerhard.petracek@gmail.com> wrote:
> > hi stephen,
> >
> > if you remove:
> >
> >     <context-param>
> >         <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
> >         <param-value>false</param-value>
> >     </context-param>
> >
> > everything works as expected.
> >
> > regards,
> > gerhard
> >
> > http://www.irian.at
> >
> > Your JSF/JavaEE powerhouse -
> > JavaEE Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
> >
> >
> > 2012/10/24 Stephen More <stephen.more@gmail.com>
> >
> >> Here is an example showing the issue:
> >>
> >> svn co https://maven-examples.googlecode.com/svn/trunk/prime-codi
> >> cd prime-codi
> >> mvn jetty:run
> >>
> >> http://127.0.0.1:9090/helloworld/index.jsf
> >>
> >> ( View page source == end of html file look like:  </li></ul></body>
> >> </html> )
> >>
> >> Click "Count" so the Count increases to 0.
> >>
> >> Now view page source again...bottom now shows:
> >>
> >> </ul></body></html><link type="text/css" rel="stylesheet"
> >> href="/helloworld/javax.faces.resource/primefaces.css.jsf?ln=primefaces"
> >> />
> >>
> >>
> >> -Stephen More
> >>
> >>
> >> On Tue, Oct 23, 2012 at 11:02 AM, Gerhard Petracek
> >> <gerhard.petracek@gmail.com> wrote:
> >> > hi stephen,
> >> >
> >> > codi doesn't use that part of the jsf-api.
> >> > ed is currently working on [1], but besides that he isn't aware of an
> >> issue.
> >> > it would be great if you can provide a link to a sample application
> which
> >> > illustrates the issue.
> >> >
> >> > regards,
> >> > gerhard
> >> >
> >> > [1] http://java.net/jira/browse/JAVASERVERFACES-2552
> >> >
> >> > http://www.irian.at
> >> >
> >> > Your JSF/JavaEE powerhouse -
> >> > JavaEE Consulting, Development and
> >> > Courses in English and German
> >> >
> >> > Professional Support for Apache MyFaces
> >> >
> >> >
> >> > 2012/10/23 Stephen More <stephen.more@gmail.com>
> >> >
> >> >> I am having a JSF resource injection issue, and I think the bug may
> >> >> exist in CODI.
> >> >>
> >> >> Working scenarios will display jquery like this:
> >> >>    <head> ...  <script type="text/javascript"
> >> >>
> >> >>
> >>
> src="/pro/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces"></script>
> >> >> ...   </head>
> >> >>
> >> >> Broken scenarios will display jquery at the very end of the html
> >> >> output like this:
> >> >>     </body></html><script type="text/javascript"
> >> >>
> >> >>
> >>
> src="/pro/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces"></script>
> >> >>
> >> >> The component contains:
> >> >> @ResourceDependencies({
> >> >>         @ResourceDependency(library="primefaces",
> >> name="jquery/jquery.js"),
> >> >>         @ResourceDependency(library="primefaces",
> name="primefaces.js")
> >> >> })
> >> >>
> >> >> Working stacks:
> >> >>     Mojarra 2.0.9 + weld + CODI
> >> >>     Mojarra 2.1.6 + weld + CODI
> >> >>     Mojarra 2.1.7 + weld + CODI
> >> >>     Mojarra 2.1.13
> >> >>
> >> >> Broken stacks:
> >> >>     Mojarra 2.1.8 + weld + CODI
> >> >>     Mojarra 2.1.10 + weld + CODI
> >> >>     Mojarra 2.1.13 + weld + CODI
> >> >>     Mojarra 2.1.13 + OpenWebBeans + CODI
> >> >>
> >> >>
> >> >> Is there some compatibility issue between Mojarra 2.1.8 and above and
> >> >> CODI 1.0.5 ?
> >> >>
> >> >> -Stephen More
> >> >>
> >>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message