您的位置:首页 > 其它

resin2/resin3如何实现“更新class,服务不重启”这样的功能?

2011-04-18 11:42 766 查看
resin2/resin3如何实现“更新class,服务不重启”这样的功能?

查阅一些资料得知,在Win平台,用 httpd.exe -XDebug 参数来启动 hot-swap 功能,是可以实现class自动重载,而服务不重启

但是在linux平台,httpd.sh 并没有 -Xdebug这个参数,附带参考文档中也没有任何关于hot-swap的说明

只有在官方网站上有这么一段
Class compilation
Resin provides a built-in build process that causes changes
to Java source files to be recognized and compiled
immediately, avoiding the overhead of the build step in the
code-build-test cycle. Hot swap features allow for changes
to class files to be immediately loaded into a running
application without requiring a restart of the server or the application being developed.

有没有对这个东西有研究的朋友可以说一说

1、开发期禁用框架缓存:
如果修改了配置和html模版后,必须重新启动服务器,将把人郁闷致死。在tomcat启动时加入系统参数:
-Dorg.apache.tapestry.disable-caching=true -Dorg.apache.tapestry.enable-reset-service=true
如果在eclipse WTP中启动tomcat,就加在服务运行的VM arguments中。
2、Tomcat HotSwap配置:
没有什么特殊的,编辑tomcat的配置,在Modules子页中去掉项目的Auto Reload选项,打开Overview子页Server区域中的Enable Tomcat debug mode,这样,更新了class文件后,就不用重新启动服务器或者重新加载context了。配合(1、)可以出现即时修改即时观看结果的效果了,很方便D。
3、编码问题:
Tapestry4.0的一些默认编码是iso-8859-1的,一般我们要用UTF-8的,这样修改就行了。在${yourServletName}.application文件中加入如下配置:
<meta key="org.apache.tapestry.messages-encoding" value="UTF-8" />
<meta key="org.apache.tapestry.output-encoding" value="UTF-8" />
<meta key="org.apache.tapestry.template-encoding" value="UTF-8" />

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/pypy_lumin/archive/2006/08/15/1067442.aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐