YCOE

You Can't stOp mE!

导航

[原创]DWR+OSGi整合v2.0

Posted on 2007-09-19 10:41  YCOE  阅读(1760)  评论(1编辑  收藏  举报
前天发表了一篇DWR+OSGi整合的文章,那篇文章对DWR+OSGi的整合还不是很完善,现在这里提供一种比较完善的方法。也算是对上篇后面提出问题的解答。
  在这之前,都还是建立在要修改dwr.jar源码的基础上。这个版本,可以在不修改dwr.jar的基础上进行。这样可以很方便地升级dwr,对于使用者也减少了很多的工作量。好了,让我们去看一看:

  首先,创建一个普通的Plug-in工程。建个lib目录,导入用到的jar文件。然后修改启动文件Activator.java。与上一篇《[原创]DWR与OSGi的整合》一样。然后再创建DWR-AJAX目录,把dwr.jar\org\directwebremoting 里面的dwr.xml文件拷到此目录。再次,创建一个DwrLoador.java,源代码也与《[原创]DWR与OSGi的整合》一模一样。好了,再配置一下项目的MANIFEST.MF文件,添加DWR-AJAX: /USYS-INF/dwr.xml,/USYS-INF/testAjax.xml

  这里,testAjax.xml是我们的测试文件,可以添加N个DWR的配置文件,以,隔开。当然,可以分布在不同的Bundle里面了。测试文件自己编写。
2007-9-19 10:39:19 org.directwebremoting.util.CommonsLoggingOutput info
信息: DWR Version 
2.0.1 starting.
2007-9-19 10:39:19 org.directwebremoting.util.CommonsLoggingOutput info
信息: - Servlet Engine: Equinox HttpService/
1.0
2007-9-19 10:39:19 org.directwebremoting.util.CommonsLoggingOutput info
信息: - Java Version:   
1.5.0_12
2007-9-19 10:39:19 org.directwebremoting.util.CommonsLoggingOutput info
信息: - Java Vendor:    Sun Microsystems Inc.
/ajax/about>>>>>>>>>>>>>>>>>>>
===================================
<html><head><title>DWR - Easy Ajax for Java</title></head><body><h1 style
='font-size:100%;font-weight:normal;'>This site is using <a href='http://getahead.org/dwr'>DWR - Easy Ajax for Java</a>.</body></html>
===================================