Mule 3.4.0中对Ajax的应用
?
?
?
?
?
mule配置文件:
?
?
测试:
public static void main(String[] args) { try { Server httpServer = new Server(8090); String configFile = "mule-ajax-config.xml"; String[] configFileArr = new String[] {configFile }; MuleContextFactory muleContextFactory = new DefaultMuleContextFactory(); MuleContext context = muleContextFactory .createMuleContext(new SpringXmlConfigurationBuilder(configFileArr)); Context c = new Context(httpServer, "/", Context.SESSIONS); c.addServlet(new ServletHolder(new MuleAjaxServlet()), "/ajax/*"); c.addEventListener(new MuleServletContextListener(context, null)); httpServer.start(); } catch (Exception e) { e.printStackTrace(); } }}?