添加自定义对象,有更好的方式可以通知我。
public class StartupListener extends ServerListener {
public void contextInitialized(ServletContextEvent contextEvent) {
String path = contextEvent.getServletContext().getContextPath();
JFinalViewResolver.engine.addSharedObject("ctx",path);
super.contextInitialized(contextEvent);
}
}