Reputation: 3738
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)?
Upvotes: 2
Views: 952
Reputation: 17523
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!
Upvotes: 2
Reputation: 1188
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/
Upvotes: 2
Reputation: 328754
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.
Upvotes: 2
Reputation: 49197
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?
Upvotes: 3