简体   繁体   English

iPad应用程序-访问基于Java的Web服务器

[英]Ipad application - Access a java based web server

I would like to create a native ipad application that displays data fetched from a webserver. 我想创建一个本地ipad应用程序,以显示从Web服务器获取的数据。 The application should be able to fetch tabular data, schedule things on the webserver and receive alerts 该应用程序应该能够获取表格数据,在Web服务器上安排事务并接收警报

I suppose i could do the following 我想我可以做到以下几点

For fetching tabular data, use a single webservice call (will this work? what should be data interchange format? are there limitations to the data payload?) 要获取表格数据,请使用单个Web服务调用(这可以工作吗?数据交换格式应该是什么?数据有效载荷是否有限制?)

For receiving alerts, would a persistent connection strategy work be the best way and are there better alternatives that i can tap into natively? 对于接收警报,持久连接策略是否是最好的方法,我是否可以更好地替代本机?

What remoting mechanisms are supported natively? 本机支持哪些远程处理机制?

I have glassfish/spring setup. 我有玻璃鱼/弹簧装置。

Thanks 谢谢

苹果工具箱提供NSUrlConnection

Your iPad app and your web server would have to be very loosely coupled. 您的iPad应用程序和Web服务器必须非常松散地耦合。

Your question is very broad at the moment. 您的问题目前非常广泛。 While you go, other question will arise. 当您走时,还会出现其他问题。

One pointer though: You must find an exchange protocol that suits your needs (eg JSON) and implement this on both sides. 但是有一个指针:您必须找到一个适合您需要的交换协议(例如JSON),并在双方都实现。 The choice depends on your experience and the data you want to exchange. 选择取决于您的经验和要交换的数据。

Having no idea of the data makes it hard to answer. 对数据一无所知,很难回答。

A successful method applied by many is the web service method, with simple query when the app loads, or is used, and fall back to show data that was loaded last time it had a connection. Web服务方法是许多人成功应用的一种方法,该方法可在应用加载或使用时进行简单查询,然后回退以显示上一次具有连接时加载的数据。

If the data is time sensitive, this is more of a dilema. 如果数据是时间敏感的,则这更像是一个难题。

You could simply note the last refresh time. 您可以简单地记录上一次刷新时间。 If your app will be used primarily in the office, this might suffice. 如果您的应用程序主要在办公室使用,则可能就足够了。

Having a refresh button is a must. 必须有刷新按钮。

The only reason to think about a persistent connection is if you want some form of server push. 考虑到持久连接的唯一原因是是否需要某种形式的服务器推送。 That is, do you need the server to inform the device of updates. 也就是说,您是否需要服务器通知设备更新。 Use cases for this are things like "chat". 用例是“聊天”之类的东西。

Otherwise a timer asking for updates from the server is the way to go, since it is SO much easier to develop. 否则,计时器就需要从服务器请求更新,因为它很容易开发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM