有没有办法在 Spring Boot 中运行Madvoc Web 微框架?
Spring Boot 允许集成其他技术(我们试验了在 Spring Boot 下运行的 Apache Wicket)。
这对JODD madvoc 来说可能吗?有没有合适的配置示例?
编辑#1 我尝试为 Madvoc 添加 Spring Boot servlet 过滤器配置,但看不到像这样的 Madvoc init 输出:
INFO jodd.madvoc.Madvoc - Madvoc starting...
INFO jodd.madvoc.Madvoc - Default Madvoc web application created.
这就是我的初始化代码的样子......
@Configuration
public class MadvocInitializer implements ServletContextInitializer {
@Override
public void onStartup(ServletContext sc) throws ServletException {
FilterRegistration filter = sc.addFilter("madvoc", MadvocServletFilter.class);
filter.setInitParameter("madvoc.webapp","app.web.jodd.AppWebApplication");
EnumSet NON_ASYNC_DISPATCHER_TYPES =
EnumSet.of(DispatcherType.FORWARD, DispatcherType.INCLUDE,DispatcherType.REQUEST);
filter.addMappingForUrlPatterns(NON_ASYNC_DISPATCHER_TYPES, true, "/jodd/*");
System.out.println("+++ MADVOC FILTER");
}
}
编辑 #2 过滤器配置引用“AppWebApplication”,如下所示。我可以看到来自“registerMadvocComponents”代码的打印消息,所以肯定有东西在运行。
public class AppWebApplication extends WebApplication {
@Override
public void registerMadvocComponents() {
super.registerMadvocComponents();
System.out.println("+++ MADVOC FILTER - configuration");
registerComponent(MadvocConfig.class);
// registerComponent(MyRewriter.class);
}
}