on 10-16-2006 4:32 PM
Hi,
in my JSP I try to find the language of the user and display it as shown below. When I make an iview out of it and assign it to a role further assigned to a user, whenever he changes the language from personalize the display is proper as depicted in the code.
But when I assign this to a role and then to the "anonymous group" of users, it throws an error even when only the part of the code in italics exists in the JSP.
<i><b><%
IPortalComponentRequest currentRequest =(IPortalComponentRequest)pageContext.getAttribute(javax.servlet.jsp.PageContext.REQUEST);
IUserContext iuc = currentRequest.getUser();
Locale lang = iuc.getLocale();
String n = lang.getDisplayName();
%></b></i><html>
<%
if (n.equalsIgnoreCase("English"))
{
%>
<b>ENGLISH</b>
<%
}
else
{
%>
<b>NOT ENGLISH</b>
<%
}
%>
An update on this:
When I echoed the user name it shows me guest even if I use named anonymous users using guest_user=XYZ or ABC
And Guest has no locale so it throws an error. So what can I do regarding this, I need to find out the locale of the named anonymous users and display the language.
IPortalComponentResponse currentResponse =(IPortalComponentResponse)pageContext.getAttribute(javax.servlet.jsp.PageContext.RESPONSE); IUserContext iuc = currentRequest.getUser();currentResponse.write("Hello "+iuc.getDisplayName());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.