0

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.

Dhruv Pandey
  • 482
  • 6
  • 18

1 Answers1

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