CouchDB的Ajax交互 [英] CouchDB AJAX interaction

查看:187
本文介绍了CouchDB的Ajax交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写CouchDB的样本。我的本意是用AJAX写一个web应用程序,并在Tomcat环境中部署它。当我使用CouchDB的,我想知道与CouchDB的服务器进行交互的方式。但是有几个例子,但我有一些担忧的。

I'm writing a CouchDB sample. My intention is to write a web app using AJAX and deploy it in the tomcat environment. As I use the CouchDB I would like to know the way to interact with the CouchDB server. However there were few examples but I have few concerns over that.

1)由于我的应用程序部署在Web服务器,才有可能与CouchDB的外连接?许多例子使用其部署在CouchApp或沙发环境本身。

1) As my application is deployed in a web server is it possible to connect with a CouchDB outside? Many examples uses apps which are deployed in CouchApp or Couch environment itself.

2)如果是的话会什么时候结束了跨域问题。我在这里找到这个

2) If so will it end up with cross domain issues. I found this in here

连接AJAX,CouchDB的和JavaScript

不过这会是一个问题?这是实现这一目标的正确方法是什么?

However will this be a problem? Is this the correct way to achieve this?

3)要省略上述问题是有可能使用一些服务器端的JavaScript实现,例如,犀牛?

3) To omit above issues is it possible to use some server side javascript implementation as an example Rhino?

http://www.mozilla.org/rhino/doc.html

4)如果我用犀牛上面它不会让许多Java脚本库使用。我如何使用CouchDB互动呢?我必须调用本地JavaScript?我不能使用类似JQuery的?

4) If I use Rhino above it wont allow many java script libraries to use. How do I interact with CouchDB then? Do I have to invoke native Javascript? Cant I use something like JQuery?

5)什么是客户端最好的库来实现我的目标是什么?

5) What are the best libraries for client side to achieve my goal?

您的帮助是AP preciated。

Your help is appreciated.

感谢您

推荐答案

根据您的需要使用Tomcat,我只是建议使用EKTORP(http://ektorp.org/)。试想EKTORP像JDBC驱动程序。无需从用户界面,或不需要在服务器上使用的JavaScript从Java做阿贾克斯。

Based on your need to use tomcat, I would just recommend using ektorp (http://ektorp.org/). Just think of ektorp like a jdbc driver. No need to do ajax from the user interface, or no need to use javascript from java in your server.

EKTORP也可以让你注释你的java类与JavaScript的CouchDB的需要做出的意见。看到这里的例子: http://ektorp.org/reference_documentation.html#d100e753

Ektorp also lets you annotate your java classes with the javascript couchdb needs to make views. see the example here: http://ektorp.org/reference_documentation.html#d100e753

希望有所帮助。

这篇关于CouchDB的Ajax交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆