Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay 7.3 - Spring MVC Portlet adds js/css resources twice
Hello!
Liferay 7.3.0
When I use js/css resources in standard spring-mvc-portlet (from maven archetype) with liferay-portlet.xml
The resources adds at the page twice:
But!
When I try use native example without spring - war-mvc-portlet (from maven archetype), it works correctly
Easy way - not to use <header-portlet-css> when using spring and add resources in portlet body. But...
Liferay 7.3.0
When I use js/css resources in standard spring-mvc-portlet (from maven archetype) with liferay-portlet.xml
<portlet>
...
<header-portlet-css>/css/main.css</header-portlet-css>
...
</portlet>The resources adds at the page twice:
<link href="/o/jsp-spring-mvc-portlet/css/main.css?browserId=firefox&themeId=classic_WAR_classictheme&minifierType=css&languageId=en_US&b=7301&t=1599805556000" rel="stylesheet" type="text/css">
<link href="/o/jsp-spring-mvc-portlet/css/main.css?browserId=firefox&themeId=classic_WAR_classictheme&minifierType=css&languageId=en_US&b=7301&t=1599805556000" rel="stylesheet" type="text/css">Similar behavior with native example on github: /liferay-blade-samples/tree/7.0/maven/apps/springmvc-portletBut!
When I try use native example without spring - war-mvc-portlet (from maven archetype), it works correctly
<link href="/o/war-mvc-portlet/css/main.css?browserId=firefox&themeId=classic_WAR_classictheme&minifierType=css&languageId=en_US&b=7301&t=1599824288000" rel="stylesheet" type="text/css">
Easy way - not to use <header-portlet-css> when using spring and add resources in portlet body. But...