Foren

Liferay + Vaadin 7.5 gzip / javascript problem

Goran Petanjek, geändert vor 8 Jahren.

Liferay + Vaadin 7.5 gzip / javascript problem

New Member Beiträge: 3 Beitrittsdatum: 30.08.12 Neueste Beiträge
This post is c/p from https://www.liferay.com/web/26526/blog/-/blogs/vaadin-7-control-panel-is-compatible-with-vaadin-7-5-0 to open discussion here.

Hi David!

Can you please tell me how did you solve double compression problem with Liferay + Vaadin 7.5? Vaadin introduced in 7.5 new feature to serve compressed .js (and in 7.5.1 .css) files build by widgetset compilation and Liferay apperently double compress those file so I get Content Encoding error for all .js and .css files served by Vaadin servlet.

I turned off Liferay GZip filter by setting: com.liferay.portal.servlet.filters.gzip.GZipFilter=false, but I still get Content Encoding errors.

Can you please help me, thank you in advance and best regards,
Goran Petanjek
Goran Petanjek, geändert vor 8 Jahren.

RE: Liferay + Vaadin 7.5 gzip / javascript problem

New Member Beiträge: 3 Beitrittsdatum: 30.08.12 Neueste Beiträge
Hi again!

After further investigation appears that com.liferay.portal.servlet.filters.language.LanguageFilter is the one causing problems. If I turn it off, Vaadin portlets are working without issues, and if it is on it causes content encoding errors and js files are not loaded.

Maybe because LanguageFilter are processing js files which are compressed?
I need multi language support in portal, so I can't leave it off emoticon
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: Liferay + Vaadin 7.5 gzip / javascript problem

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
K, it looks like compression of the static files, the JS and the CS happens during the compilation of the widgetset and theme.

The VaadinPortlet code does not return the compressed static resources, but the VaadinServlet does. The VaadinServlet class, when asked to return one of the static resources, will attempt to return the compressed version instead of the uncompressed version.

You don't really need a VaadinServlet for your static resources if you are using the shared environment. Are you using shared env or standalone?

You can extend the VaadinServlet class to override the allowServePrecompressedResource() method to always return false, that way it shouldn't use the compressed resources at all when your class is in use.

Also I'd suggest opening a bug through vaadin.com to allow disabling the serving of static resources via an init param. I've added the ticket already, you can check it out here: https://dev.vaadin.com/ticket/18494. You might add a comment or something to show you support resolving it...

All to often they (Vaadin) focus on just the servlet side of things and, although Vaadin runs great in the portal, we sometimes have to remind them that we're still here emoticon
Goran Petanjek, geändert vor 8 Jahren.

RE: Liferay + Vaadin 7.5 gzip / javascript problem

New Member Beiträge: 3 Beitrittsdatum: 30.08.12 Neueste Beiträge
Hi David!

Thank you for response.

I'm using standalone environment (having just one Vaadin portlet on public and one on private pages).

I tried your suggestion overriding VaadinServlet and it works! Until Vaadin team fixes that we can turn off automatic compression, this is best solution.

Best regards,
Goran Petanjek