To estudando jsf ... e fiz uma parte que crio um filtro para validar o login do usuário nas paginas, eu criei o filtro AuthFilter, adicionando o web.xml e coloquei para o filtro aplicar como /*.jsp e /*.faces, porém na hora que vou compilar o projeto ele já dá um erro e nem continua, se eu apago essa classe ai volta a funcionar....
esse é o erro
init: deps-module-jar: deps-ear-jar: deps-jar: library-inclusion-in-archive: library-inclusion-in-manifest: compile: compile-jsps: Executando implantação incremental para http://localhost:8080/MyFirstCompleteJSFApp Distribuição incremental do http://localhost:8080/MyFirstCompleteJSFApp completada Reimplantando http://localhost:8080/MyFirstCompleteJSFApp incrementalmente Inicialização em andamento... start?path=/MyFirstCompleteJSFApp FAIL - Application at context path /MyFirstCompleteJSFApp could not be started R:\NetBeans\MyFirstCompleteJSFApp\nbproject\build-impl.xml:714: O módulo não foi implementado. at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187) at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397) at org.apache.tools.ant.Project.executeTarget(Project.java:1366) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1249) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154) FALHA NA CONSTRUÇÃO (tempo total: 0 segundos)
esse é o código que eu alterei...
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 not logged process
if (logged == null || ((Boolean)logged).booleanValue() == false) {
//Permit login
if (!url.contains("login")) {
resp.sendRedirect("login.faces");
}
}
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();
}
}