I want to include a js file depending on the value of the current Locale. I have tried to access it from JSP as follows:
<%@ page import="java.util.Locale" %>
<% if( ((Locale) pageContext.getAttribute("org.apache.struts.action.LOCALE",PageContext.REQUEST_SCOPE)).getLanguage().equals("de")) { %>
<script src="../themes/administration/js/languages/i18nDE.js" type="text/javascript"> </script>
<% } else { %>
<script src="../themes/administration/js/languages/i18nEN.js" type="text/javascript"> </script>
<% } %>
However, I am getting a java.lang.NullPointerException because pageContext.getAttribute("org.apache.struts.action.LOCALE",PageContext.REQUEST_SCOPE) is NULL.
Does anyone knows how can i solve this?