我正在使用webfilter来控制对我的JSF应用程序中所有页面的访问,过滤器确保用户是否已登录然后将其重定向到他的主页,如果不是,用户将被重定向到登录表单,每个事情很好,但页面看起来不太好(没有CSS)
这是我的网络过滤器
@WebFilter(filterName = "UsersessionFilter",
urlPatterns = {"/*"})
public class UsersessionFilter implements Filter {
我的webfilter中的重定向部分
if (useression != null) {
boolean islogged = useression.getEmployee() != null;
if (!islogged) {
if (!_curent_Request_url.equals(_context_path + "/faces/wolcome.xhtml")) {
httpresponse.sendRedirect(_context_path + "/faces/wolcome.xhtml");
} else {
chain.doFilter(request, response);
}
} else {
try {
employee = useression.getEmployee() ;
} catch (Exception ex) {
Logger.getLogger(UsersessionFilter.class.getName()).log(Level.SEVERE, null, ex);
}
if (("E").equals(employee.getGrad()) && !_curent_Request_url.equals(_context_path + "/faces/mainEmployee.xhtml")) {
httpresponse.sendRedirect(_context_path + "/faces/mainEmployee.xhtml");
} else if (("R").equals(employee.getGrad()) && !_curent_Request_url.equals(_context_path + "/faces/mainAdmin.xhtml")) {
httpresponse.sendRedirect(_context_path + "/faces/mainAdmin.xhtml");
}
else
chain.doFilter(request, response);
}
}
else chain.doFilter(request, response);
我正在使用glassfish服务器3.1.2
感谢的