Friday 15 August 2014

encoding - Why is .properties file read differently by DispatcherPortlet and MVCPortlet? -



encoding - Why is .properties file read differently by DispatcherPortlet and MVCPortlet? -

i developing liferay portal, have 2 different types of portlets:

<portlet> <portlet-class>org.springframework.web.portlet.dispatcherportlet</portlet-class> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> </supports> <supported-locale>de</supported-locale> <supported-locale>en</supported-locale> <resource-bundle>path.to.resource</resource-bundle> ... </portlet>

and

<portlet> <portlet-class>com.liferay.util.bridges.mvc.mvcportlet</portlet-class> <supports> <mime-type>text/html</mime-type> <portlet-mode>help</portlet-mode> </supports> <supported-locale>de</supported-locale> <supported-locale>en</supported-locale> <resource-bundle>path.to.resource</resource-bundle> ... </portlet>

the problem first portlet reads resource bundle in iso-8859-1 encoding, while sec 1 in utf-8. results displaying special characters äöüß in weird way in 1 of portlets. if resource bundle (.properties file) contains ä beingness displayed weirdly in first portlet. if resource bundle contains utf-8 encoded \u00e4 beingness displayed wrongly in sec portlet. reason , how resolved?

as liferay assumes resources utf-8, way work around have 2 different resource files both portlets. unfortunate, solution can think of.

encoding liferay portlet

No comments:

Post a Comment