2017-05-03 36 views

回答

0

抱歉發佈問題,但答案可能對其他人有幫助。只需創建一個jsp並在其中添加此代碼

<%@ page import="com.liferay.portal.util.PortalUtil" %> 
<%@ page import="com.liferay.portal.NoSuchLayoutException" %> 
<%@ page import="com.liferay.portal.service.LayoutLocalServiceUtil" %> 
<%@ page import="com.liferay.portal.util.WebKeys" %> 
<%@ page import="com.liferay.portal.model.LayoutSet" %> 
<%@ page import="com.liferay.portal.model.User" %> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 

<% 

User currentUser=null; 

try { 
    currentUser = PortalUtil.getUser(request); 
} catch (Exception e) { 
    e.printStackTrace(); 
} 
%> 
+0

看來您的答案並不完整。我看不到語言特定的開關... –

+0

的想法是獲得當前用戶。一旦我有當前用戶。語言可以從那裏獲取。沒什麼大不了。 –