Document directory
- 1. Determine whether the user has logged on to liferay. The corresponding model user _
- 2. Load the static resource file barebone. jsp, everything. jsp
- 3. i18n
1. Determine whether the user has logged on to liferay. The corresponding model user _
User user = portalutil.Getuser(Request );
2. Load the static resource file barebone. jsp, everything. jsp
When loading JS files, liferay was optimized. a js file that only introduced the least needed was finally combined into barebone. JSP. One is to introduce all JS files and combine them into everything. JSP,
In portal-Web/docroot/html/common/themes/top_js.jspf, you can judge the JS
There is a configuration item in the Portlet. properties.
Javascript. barebone. Enabled = true
When set to true, the file is loaded from the path specified by JavaScript. barebone. Files.
When set to false, the file in the path specified by JavaScript. Everything. files will be loaded.
The number of files in "javascript. barebone. Files" is indeed more than that in "javascript. Everything. Files", but the comment is not displayed.
3. Load i18n in the i18njs File
Liferay.Language.get('add-account')
Sends an IO request, which is placed in the JS object cache of the current page.
Loading i18n from JSP files
<liferay-ui:message key="unable-to-connect-with-mail-server" />
Pre-compilation method, fast loading
Load i18n In the AuI script
<aui:input label="use-secure-incoming-connection" name="incomingSecure" type="checkbox" />
You can specify a label, and the corresponding label will be automatically parsed. If no label Label is specified, the name will be used as the label to query the corresponding i18n