`
yangyou230
  • 浏览: 1650494 次
文章分类
社区版块
存档分类

用CppCMS实现web site并同时支持json_rpc服务

 
阅读更多

刘怀宇

1.将cppcms-0.99.10/examples/json_rpc/rpc.cpp文件中的json_service类拷贝到
examples/templates/hello-tmpl.cpp 中
2.修改hello-tmpl.cpp 中的main函数,添加两个服务



3.修改config.js 文件,添加 script_names : /jsonrpc , /html




4.在first.tmpl 中使用如下的html文本 替换掉原来的html




5.make
6. 执行生成的hello-tmpl ./hello-tmpl -c config.js

7. 访问http://localhost:8080/html 在返回的html页面中计算除法,即可成功访问后台的json服务,得到结果

8.注意,IE6不支持JSON_RPC技术。


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics