Combination View Flat View Tree View
Threads [ Previous | Next ]
Fabio Margarido
Error message when using primefaces-extensions tooltip component
January 15, 2013 11:39 AM
Answer

Fabio Margarido

Rank: New Member

Posts: 6

Join Date: September 27, 2012

Recent Posts

Hi there,

when I use the tooltip component from primefaces-extensions in my portlet, I get the following error message:

17:35:44,332 ERROR [com.liferay.faces.bridge.context.url.BaseURLNonEncodedStringImpl] (http--0.0.0.0-8080-5) Invalid name=value pair=[amp;v=0.6.2] in URL=[http://localhost:8080/group/guest/db1?p_p_id=AIP_VisualizacaoGrafico_WAR_AIP_Portlet_Config_INSTANCE_NqvJU1LtkoBp&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_AIP_VisualizacaoGrafico_WAR_AIP_Portlet_Config_INSTANCE_NqvJU1LtkoBp_javax.faces.resource=tooltip%2Ftooltip.js&_AIP_VisualizacaoGrafico_WAR_AIP_Portlet_Config_INSTANCE_NqvJU1LtkoBp_ln=primefaces-extensions&v=0.6.2]


Despite the error, everything seems to be working fine.
Can someone please confirm if this message is harmless? Is there any way I can prevent it from filling my log files?
Thanks in advance!
Neil Griffin
RE: Error message when using primefaces-extensions tooltip component
January 15, 2013 12:12 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1993

Join Date: July 26, 2005

Recent Posts

This looks like a bug in primefaces-extensions, such that the "non-encoded" URL has an encoded ampersand "&v=0.6.2" instead of "&v=0.6.2"

This looks like a request for a JSF2 resource. During the early development of the JSF2 spec, I think there was a "v" URL parameter to specify a version. But in the final version of the JSF2 spec, it's not there. So I think that if primefaces-extensions should be fixed so that it simply does not append the version in the URL.

If you're not able to fix primefaces-extensions, or not able to wait for the project committers to fix it, and you need to stop your logs from filling-up, then let me know and I can show you how to extend the bridge to avoid that.
Fabio Margarido
RE: Error message when using primefaces-extensions tooltip component
January 16, 2013 2:31 AM
Answer

Fabio Margarido

Rank: New Member

Posts: 6

Join Date: September 27, 2012

Recent Posts

Hi Neil, thank you for the quick as usual reply.

I'll get in touch with the primefaces-extensions developers and see what they can do.

Even if they fix the error and in the end it's not necessary, I think it would be useful to know how to change the bridge to avoid that log message, so if you could please show me how to do it I'd be grateful.

Thanks again.
Fabio Margarido
RE: Error message when using primefaces-extensions tooltip component
January 16, 2013 8:45 AM
Answer

Fabio Margarido

Rank: New Member

Posts: 6

Join Date: September 27, 2012

Recent Posts

Neil, I got the following answer from Oleg, primefaces-extensions project leader, who asked me to post it here:

In the Servlet environment, it doesn't matter if you have appended "&v=0.6.2" or "&v=0.6.2". Servlet env. can handle both, so it's reliable there as far as I know. Don't know about portlets, but PrimeFaces core had the same encoded ampersand in URLs a some time ago. We need the release version in URLs to avoid browser caching. I can not remember, but I think we tried with non encoded "&v=0.6.2" and had some issues. We will discuss this subject and post an answer here (https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues/46).


Thank you.
Neil Griffin
RE: Error message when using primefaces-extensions tooltip component
January 16, 2013 11:23 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1993

Join Date: July 26, 2005

Recent Posts

Regarding the URL parameter:

I had an email conversation with Çağatay about this back in May of 2012. He said that PrimeFaces 3.3+ no longer appends the "&v=" URL parameter.

BTW, according to Ryan Lubke's blog, the version is handled automatically by the Mojarra ResourceImpl class.

Also, there are no methods on the JSF API ResourceHandler.createResource* methods that take a version.

Regarding the ability to extend the bridge:

I just posted a new tutorial in the Liferay Faces Wiki titled Extending Liferay Faces Bridge via Factory Wrappers.

In this case, I would recommend that you wrap/decorate the BridgeURLFactory.getBridgeResourceURL(String, String, BridgeContext) method so that it removes the "&v=xyz" from the URL before delegating to getWrapped().getBridgeResourceURL(String, String, BridgeContext)
Neil Griffin
RE: Error message when using primefaces-extensions tooltip component
January 16, 2013 1:00 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1993

Join Date: July 26, 2005

Recent Posts

BTW, I just developed the following wrappers. They won't be included in liferay-faces-bridge-impl.jar until the next release, but you can look at the source for now. The BridgeResourceURLWrapper could help in your case, should you wish to put the abstraction into a wrapper for the URL, rather than in the factory.

Fabio Margarido
RE: Error message when using primefaces-extensions tooltip component
January 21, 2013 5:47 AM
Answer

Fabio Margarido

Rank: New Member

Posts: 6

Join Date: September 27, 2012

Recent Posts

Hi Neil, thanks for all the info.

After some more discussion in the primefaces-extensions issu tracker, Oleg fixed the issue in their code. I haven't had the chance to update my app and test it again yet. However, this is what he said after they corrected the issue:

I changed the encoded ampersand to non encoded. Everything runs fine. But as I could saw, the ampersand in the generated HTML is still encoded. Not sure, who encodes the ampersand (perhaps JSF). So, no guarantee that it will run in Liferay. Probably you should use the proposed bridge.


So maybe I'll still need to mess with the bridge to help in my case.

I'll let you know if I still need more info when I test it.

Thanks again.
Neil Griffin
RE: Error message when using primefaces-extensions tooltip component
January 21, 2013 8:37 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1993

Join Date: July 26, 2005

Recent Posts

OK, thanks. I am looking forward to learning if it works for you.