开发者

Is it possible to create an offline application with Wicket?

开发者 https://www.devze.com 2023-02-16 01:21 出处:网络
Is there a开发者_如何学编程 way to make an offline application using Wicket? If so, would it be necessary to use another tool/framework (Gears, Spring, etc)?Wicket is a server-side technology, just li

Is there a开发者_如何学编程 way to make an offline application using Wicket? If so, would it be necessary to use another tool/framework (Gears, Spring, etc)?


Wicket is a server-side technology, just like servlets, jsp, etc; meaning that it generally requires an application-server to host the application. There's no offline equivalent that I'm aware of.

Spring can be also be run on an application server or be used to construct desktop applications. Perhaps you'll consider a desktop application to be offline?


Maybe. Of course, you can use Wicket to generate HTML and JavaScript that executes on the client only without ever talking to a server.

So you can use any technology that you like but you must write the HTML in such a way that it never sends requests. That means for example: All links and forms must be handled by JavaScript functions.


You can bundle a lightweight server with it. My favorite application that does this is Google Refine, it is a pure web app that bundles a lightweight embedded web server (Jetty): http://code.google.com/p/google-refine/


If I understand the question you are talking about HTML5 offline mode. This is what I think is the best approach: With Wicket.Ajax.registerPreCallHandler() you can add an interceptor (a function) that will check window.offline and either let the ajax call go to the server or suppress it and execute some custom JavaScript that will save the related data in browser's DB (see localStorage, IndexedDB, web sql database). I.e. it is your job to decide what to happen when linkX is clicked and there is no internet connection. In this case you'll need also to subscribe for "ononline" event and upload the collected data when the connection is back.

Sounds like a fun project. Good luck!

0

精彩评论

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