开发者

Using GWT to output XML, JSON and regular HTML

Sorry, this is a very basic question, as we are just getting started with exploring GWT.

We would like to know if it's easy and possible to get GWT to "output" XML, JSON and regular HTML. I would like to know this because ideally we would port parts of our backends over slowly, and it would be nice to drop in GWT in place of AJAX wherever we need it during the transition peri开发者_运维技巧od.

Places that we would like to be able to use:

1) We have a pure XML page that we return to our client (mobile) app and right now this is handled through Spring MVC with a nice template. What's the best replacement for this?

2) We have a regular AJAX page that makes async requests and expects replies in JSON. Can we easily replace this backend?

3) We have some regular webpages where we use templates to output them, and we would like to first switch them over in the simplest possible way, without converting them to the regular GWT UI framework.

Thanks!


Do you mean, "is it possible to get GWT to accept XML and JSON"? GWT is a framework for writing dynamic JavaScript, not static data formats like XML and JSON.

If that is your question, then yes, it's very easy for GWT to accept JSON data, and slightly harder but still possible to accept XML.

For JSON, you'll want to look into JavaScript Overlay Types. And this tutorial may be helpful in learning how to have GWT read XML-formatted data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜