In case, there are multiple jdks installed on you linux box and you want to change default JDK. Run the following commands to change the default jdk.
/usr/sbin/alternatives --config java /usr/sbin/alternatives --config javac /usr/sbin/alternatives --config java_sdk_1.7.0
If you are planning to use the international characters in the Liferay web content, Liferay Database encoding needs to be set to UTF-8.
ISO encoding is ok, if you are just thinking to use the English Western character.
It is quite important to set the right database encoding before creating the schema and table for Liferay.
If you want to show the page title as heading on each page. Better would be to embed the page title in layout template. Following is the code snippet for getting the page name which needs to be added in the layout template.
In the portlet, Caching can be disabled by setting the following response headers :
Above response headers can be set using the renderResponse object or html tags. Following are the code snippet for the same.
When publishing the website in Liferay, it’s good practice to restrict access to admin urls outside the LAN. you can block the access to urls by adding the rewrite rules on the web-server. In my case, I am using the apache webserver and following are apache configurations for the same.
httpd.conf Continue reading
When we do the portlet development in the Liferay, each input field name and request parameters needs to be prefixed with the portlet namespace.
Portletnamespace prefix is used avoid the conflict, if multiple portlets are dropped on the same page. But if you want to make your portlet work without portlet namespace prefix, it can be done by setting the requires-namespaced-parameters to false in the liferay-portlet.xml file.
<portlet> <portlet-name>customportlet</portlet-name> <icon>/icon.png</icon> <instanceable>false</instanceable> <requires-namespaced-parameters>false</requires-namespaced-parameters> </portlet>