vendredi 3 avril 2015

Why is WebApplicationInitializer ignored?

I have a Web application (war) built with maven. I'm using an old struts application (no choice). I'm refactoring old services with spring annotation using AnnotationConfigApplicationContext and a configuration class.


I use JBoss AS 7.0.1.


I need to implement web services in my application. So I'm trying to set DispatcherServlet using WebApplicationInitializer.


I've tried by implemeting, "WebApplicationInitializer", or extending "AbstractDispatcherServletInitializer", "AbstractAnnotationConfigDispatcherServletInitializer", but class is not detected and processed once JBoss is started and war is deployed.


How does Jboss to detect this type of class. Do we have to set a declaration somewhere.


sample code of my last try :



import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

@Override
protected Class<?>[] getRootConfigClasses() {
String test = "";
test.toLowerCase();
return null;
}

@Override
protected Class<?>[] getServletConfigClasses() {
String test = "";
test.toLowerCase();
return new Class[] {ApplicationContextConfiguration.class};
}

@Override
protected String[] getServletMappings() {
String test = "";
test.toLowerCase();
return new String[] {
"*.html"
,"*.json" };
}

}

Aucun commentaire:

Enregistrer un commentaire