Posts

Showing posts from 2017

Localization in liferay.

Liferay support several localization.You can easily localize your application to support more than one language. You can override existing language key and also add language key in hook. Configure your hook as below. <?xml version="1.0"?> <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> <hook>     <portal-properties>portal.properties</portal-properties>     <language-properties>content/Language_en.properties</language-properties>     <language-properties>content/Language_nl.properties</language-properties>     <language-properties>content/Language_pt.properties</language-properties> </hook> Here above hook show three language(nl,pt and en) support. Add above three language files in src/content folder. You can also say in hook, how many languages support by your application. For...

Cosuming Liferay JSON Web Services

In liferay you can write json web service  easily. You can also consume those web service from other client such in java httpclient, javascript(like ajax jquery), dukescript and other client . For example you have a portlet name test-portlet and you write a json webservice as below:     @JSONWebService(value = "testService", method = "POST")     public JSONObject testService(String test) throws SystemException {         JSONObject result = JSONFactoryUtil.createJSONObject();         result.put("test", test);         return result;     } For consuming this service from several clients you can follow below steps: 1. In java client Here you can use jersy.  Client code given below:        Client    client = ClientBuilder.newClient();         ...

How to remove POST size limit

The connector section has the parameter maxPostSize   The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes). Another Limit is: maxHttpHeaderSize The maximum size of the request and response HTTP header, specified in bytes. If not specified, this attribute is set to 4096 (4 KB). You find them in $TOMCAT_HOME / conf / server . xml   1.Find the tag entry for the HTTP 8080 connector 2.Add the maxPostSize="0" attribute and value to this tag such that it looks like:      maxHttpHeaderSize="8192"     maxThreads="150"     minSpareThreads="25"     maxSpareThreads="75"     enableLookups="false"     redirectPort="8443"     acceptCount="100" ...