Quando descomento as duas linhas que ele pede no vídeo, ele não reconhece a classe Log4jConfigListener.
package br.com.caelum;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
public class Inicializador extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] { Configurador.class };
}
@Override
protected Class<?>[] getServletConfigClasses() {
return null;
}
@Override
protected String[] getServletMappings() {
return new String[] { "/" };
}
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
// Descomente abaixo para ligar log4j!
servletContext.setInitParameter("log4jConfigLocation", "/WEB-INF/log4j.xml");
servletContext.addListener(new Log4jConfigListener());
}
}