Trails

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
  1. 仔细阅读下列文章,并实际动手:
    Equinox in a Servlet Container说明文档(教程)
    Http Service Servlets扩展点帮助
    Eclipse, Equinox, and OSGi(有图)
    Building Server-Side Eclipse based web applications 2010(PPT)
  2. :pserver:anonymous@dev.eclipse.org:/cvsroot/rt
    org.eclipse.equinox/server-side/
    1. 下载依赖插件
      org.eclipse.equinox.http.servletbridge
      org.eclipse.equinox.servletbridge
      org.eclipse.equinox.servletbridge.extensionbundle
    2. 发布参考
      org.eclipse.equinox.server.examples.servletbridge.product
      org.eclipse.equinox.server.servletbridge
  3. 创建插件工程,继承HttpServlet开发自己的Servlet类
  4. 继承ServiceTracker,在自己的类中注册第3步开发的servlets
  5. 在插件激活的时候创建并打开第4步开发的tracker
  6. 发布和激活相关的插件(通过配置和使用product文件)
    发布到tomcat\webapps\<mywebapp>\WEB-INF\
    该文件夹内容除了标准的plugins、features、configuration外,还会有lib、.eclipseproduct、launch.ini和web.xml
  7. 开http服务测试
  8. 其余要注意的点:
    1. 清tomcat\work目录里缓存的相应内容
    2. 清webapps目录相应 WEB-INF 里的内容
    3. 导出webapp.product时,在向导页面配置:
      1. Root directory为空
      2. 去掉Synchronize before exporting的勾勾
      3. Directory直接配置为WEB-INF目录,如:\apache-tomcat-6.0.29\webapps\mywebapp\WEB-INF
      4. 去掉Generate metadata repository的勾勾
      5. 点Finish
    4. 启动tomcat后,用ss查看所有插件(除了fragments)是否都是ACTIVE状态
      不是的话,在product文件Configuration里配置Auto-Start为true
    5. webapp需要的插件,feature.xml里全要自己手工加上
      注意参考equinox cvs仓库里的例子,另外可以借用webapp.product生成一个列表来参考
  9. 调试:
    1. 解压eclipse插件开发环境,然后解压eclipse jee开发环境覆盖
    2. 添加tomcat服务器,然后把webapp配置到服务器上
    3. 在servlet里下断点,启动服务器调试即可
posted on 2012-06-20 08:27  mrr  阅读(401)  评论(0)    收藏  举报