Hai<br><br>Hi i want to change locale in teeda...<br><br><b>web.xml<br></b><br><filter><br> <filter-name>requestDumpFilter</filter-name><br> <filter-class><b>projectmgnt.util.RequestDumpFilter</b></filter-class><br>
</filter><br><br><filter-mapping><br> <filter-name>requestDumpFilter</filter-name><br> <url-pattern>*.html</url-pattern><br> </filter-mapping><br><br><br><b>RequestDumpFilter .java<br>
::::::::::::::::::::::::::::::::::<br></b><br><br>public final class RequestDumpFilter implements Filter {<br><br> private FilterConfig config=null;<br> <br> public Locale locale;<br><br> public void destroy() {<br>
config=null;<br><br> }<br> public void doFilter(ServletRequest request, ServletResponse response,<br> FilterChain chain) throws IOException, ServletException {<br><br> if (request instanceof HttpServletRequest) {<br>
final HttpServletRequest hrequest = (HttpServletRequest) request;<br> final HttpSession session = hrequest.getSession(false);<br> if(session!=null){<br> <br> if<b>(request.getLocale().getLanguage().equals((String)session.getAttribute("language"))</b>){<br>
System.out.println("same");<br> <b> chain.doFilter(request,response);</b><br> return;<br> }<br> else{<br> <br>
<b>//How can i change the locale here</b><br><br><br> }<br> <br> <br> System.out.println("Get Locales"+request.getLocale().getLanguage());<br> }<br>
if(config==null){<br> return;<br> }<br><br> <b> chain.doFilter(request,response);</b><br><br> }<br> }<br> public void init(FilterConfig filterConfig) throws ServletException {<br>
config=filterConfig;<br> }<br>}<br><br><b>Login.java</b><br><br>public Class doLogin() {<br> LoginCB loginCb = new LoginCB();<br> loginCb.query().setLoginid_Equal(userid);<br> loginCb.query().setPassword_Equal(pwd);<br>
if(loginBhv.selectCount(loginCb)>0){<br> Login login = new Login();<br> login = loginBhv.selectEntity(loginCb);<br> session.setAttribute("usersession", userid);<br> <b>session.setAttribute("language", language);</b><br>
EmployeemasterCB empCb = new EmployeemasterCB(); <br> Employeemaster employee = new Employeemaster();<br> empCb.query().setEmployeecode_Equal(login.getEmployeecode());<br> employee = employeemasterBhv.selectEntity(empCb);<br>
if(employee.getDesignation().equals("admin"))<br> session.setAttribute("userlevel", "2");<br> else if(employee.getDesignation().equals("manager"))<br>
session.setAttribute("userlevel", "3");<br> else<br> session.setAttribute("userlevel", "1");<br> }<br> else{<br> FacesMessageUtil.addErrorMessage("E02");<br>
return null;<br> }<br> <br> return MenuPage.class;<br><br> }<br><br>Please instruct to solve this problem<br><br>トマス<br><br><br>