You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Stephen More <st...@gmail.com> on 2012/10/23 16:27:23 UTC

[ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

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

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by Gerhard Petracek <ge...@gmail.com>.
hi stephen,

yes - the mojarra team told me that they would appreciate a ticket about it
-> you are very welcome to file one.
summary: mojarra > v2.1.7 has an issue with dynamically added components
after the first postback, if partial state-saving is deactivated (and
components in the page use @ResourceDependency).

also the 2nd issue sounds like a bug in mojarra.

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 <st...@gmail.com>

> Thanks for all your help. ( Should I file a bug with Mojarra
> indicating problems when javax.faces.PARTIAL_STATE_SAVING == false ? )
>
> While that addressed my initial issue, I now see a new one. I use a
> style sheet to have smaller fonts globally. For the most part the
> style sheet works except for my composite components...did something
> else change from 2.0 to 2.1 or have I found yet another bizarre issue
> ?
>
> -Stephen More
>
>
> On Wed, Oct 24, 2012 at 8:01 AM, Gerhard Petracek
> <ge...@gmail.com> wrote:
> > hi stephen,
> >
> > if you have to keep your config (and since you are using the
> > ClientSideWindowHandler), you can deactivate CodiRenderKitFactory e.g.
> via:
> >
> > public class CustomClassDeactivator extends AbstractClassDeactivator
> > {
> >     @Override
> >     protected void deactivateClasses()
> >     {
> >
> >
> addDeactivatedClass(org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.CodiRenderKitFactory.class);
> >     }
> > }
> >
> > + configure it e.g. via the std. service-loader approach (-> write your
> > fully qualified class
> > in
> META-INF\services\org.apache.myfaces.extensions.cdi.core.api.activation.ClassDeactivator).
> >
> > 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 <st...@gmail.com>
> >
> >> 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
> >> <ge...@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 <st...@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
> >> >> <ge...@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 <st...@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
> >> >> >>
> >> >>
> >>
>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by Stephen More <st...@gmail.com>.
Thanks for all your help. ( Should I file a bug with Mojarra
indicating problems when javax.faces.PARTIAL_STATE_SAVING == false ? )

While that addressed my initial issue, I now see a new one. I use a
style sheet to have smaller fonts globally. For the most part the
style sheet works except for my composite components...did something
else change from 2.0 to 2.1 or have I found yet another bizarre issue
?

-Stephen More


On Wed, Oct 24, 2012 at 8:01 AM, Gerhard Petracek
<ge...@gmail.com> wrote:
> hi stephen,
>
> if you have to keep your config (and since you are using the
> ClientSideWindowHandler), you can deactivate CodiRenderKitFactory e.g. via:
>
> public class CustomClassDeactivator extends AbstractClassDeactivator
> {
>     @Override
>     protected void deactivateClasses()
>     {
>
> addDeactivatedClass(org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.CodiRenderKitFactory.class);
>     }
> }
>
> + configure it e.g. via the std. service-loader approach (-> write your
> fully qualified class
> in META-INF\services\org.apache.myfaces.extensions.cdi.core.api.activation.ClassDeactivator).
>
> 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 <st...@gmail.com>
>
>> 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
>> <ge...@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 <st...@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
>> >> <ge...@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 <st...@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
>> >> >>
>> >>
>>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by Gerhard Petracek <ge...@gmail.com>.
hi stephen,

if you have to keep your config (and since you are using the
ClientSideWindowHandler), you can deactivate CodiRenderKitFactory e.g. via:

public class CustomClassDeactivator extends AbstractClassDeactivator
{
    @Override
    protected void deactivateClasses()
    {

addDeactivatedClass(org.apache.myfaces.extensions.cdi.jsf2.impl.scope.conversation.CodiRenderKitFactory.class);
    }
}

+ configure it e.g. via the std. service-loader approach (-> write your
fully qualified class
in META-INF\services\org.apache.myfaces.extensions.cdi.core.api.activation.ClassDeactivator).

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 <st...@gmail.com>

> 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
> <ge...@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 <st...@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
> >> <ge...@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 <st...@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
> >> >>
> >>
>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
One last thing, I am only a user of MyFaces Core 2.1.9 at the moment. I'm
not using CODI or any other MyFaces libraries at the present.


On Wed, Oct 24, 2012 at 7:14 AM, Howard W. Smith, Jr. <
smithh032772@gmail.com> wrote:

> 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 <st...@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
>> <ge...@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 <st...@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
>> >> <ge...@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 <st...@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
>> >> >>
>> >>
>>
>
>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
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 <st...@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
> <ge...@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 <st...@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
> >> <ge...@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 <st...@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
> >> >>
> >>
>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by Stephen More <st...@gmail.com>.
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
<ge...@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 <st...@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
>> <ge...@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 <st...@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
>> >>
>>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by Gerhard Petracek <ge...@gmail.com>.
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 <st...@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
> <ge...@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 <st...@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
> >>
>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by Stephen More <st...@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
<ge...@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 <st...@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
>>

Re: [ CODI ] JSF resource injection issue with Mojarra 2.1.8 and above

Posted by Gerhard Petracek <ge...@gmail.com>.
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 <st...@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
>