Skip to Content
0
Former Member
Mar 30, 2011 at 03:42 PM

Redirect in a logon page

13 Views

Hello experts!

I am changing the whole structure of the logon page in Portal.

One of the requirements is to have in the header the possibility of changing the language by clicking in it, as you can see above:

PT | EN

My idea to implement this functionality was to redirect the user to a page (setlang.jsp=lang=XX) where XX is the language intended by the user.

Well, first my problem was to be able to link to the setlang.jsp, having this file in the same page than umLogonPage.jsp...

I couldn't done that, so i put the file into dist folder and included the file in the end of the umlogonpage.jsp(didn't know why that's relevant, but worked).

Now i can link to the file successfully... My intention is to store the language in a session variable, and redirect to umlogonpage.jsp... but i am having difficult with that...

here is the code of the setlang.jsp:

<%

// your default language.

String default_language = "pt";

if( "pt".equals( request.getParameter( "lang" ) ) || "en".equals( request.getParameter( "lang" ) ) )

{

session.setAttribute( "lang", request.getParameter( "lang" ) );

out.print(request.getContextPath());

// response.sendRedirect( request.getContextPath() );

response.sendRedirect( '/irj/portal' );

}

else

{

session.setAttribute( "lang", default_language );

}

%>

Is there a easy way to do that?

am i doing this the wrong way?

Thanks in advance!