I know the procedure for adding the custom 404 page. What I want is to fetch user language in 404 page and show the error message in his locale.
Asked
Active
Viewed 328 times
1 Answers
0
Sorry for Posting the question but the answer may be helpful for others. Just create a jsp and add this code there
<%@ 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();
}
%>

Dhruv Pandey
- 482
- 6
- 18
-
It seems that your answer is not complete. I can't see a language specific switch... – Tobias Liefke May 08 '17 at 19:56
-
idea was to get current user. Once I have got current user. language can be fetched from there. not an issue. – Dhruv Pandey Jul 25 '17 at 08:45