Boa noite!
Gente eu criei um filtro para fazer uma validação no usuario , para não entrar nas outras paginas sem fazer o login.
mas quando vou executar o programa ele diz “Falha na Execução”.
segue abaixo o codigo do Erro.
Executando implantação incremental para http://localhost:8080/Roonilo2
Distribuição incremental do http://localhost:8080/Roonilo2 completada
Reimplantando http://localhost:8080/Roonilo2 incrementalmente
Deploy em andamento...
deploy?config=file%3A%2FC%3A%2FUsers%2FDanilo%2FAppData%2FLocal%2FTemp%2Fcontext54729.xml&path=/Roonilo2
FAIL - Deployed application at context path /Roonilo2 but context failed to start
C:\Users\Danilo\Documents\NetBeansProjects\Roonilo2\nbproject\build-impl.xml:728:O módulo não foi implementado.
Verifique o registro do servidor para mais detalhes.
FALHA NA CONSTRUÇÃO (tempo total: 1 segundo)
Segue abaixo o codigo do meu filtro no manageBens
public String doLogin() throws SQLException, ClassNotFoundException{
boolean validated = loginDAO.validadeUser(user, password);
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("userlogged", validated);
if (validated){
return "gotoMain";
}else{
return "gotoLoginInvalid";
}
}
Segue codigo do meu Filtro.
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
String url = req.getRequestURL().toString();
Object logged = req.getSession().getAttribute("userlogged");
if (logged == null || ((Boolean)logged).booleanValue() == false){
if (!url.contains("login")){
resp.sendRedirect("login.jsp");
}
}
try {
chain.doFilter(request, response);
} catch (Throwable t) {
// If an exception is thrown somewhere down the filter chain,
// we still want to execute our after processing, and then
// rethrow the problem after that.
// t.printStackTrace();
}
}
Obrigado desde Já.