Wicket on Google App Engine
Like many others I am using Wicket on Google App Engine re-writing one of my pet projects. Google App Engine does not allow for user applications to start new threads so in order to get Wicket working, you need to disable the ModificiationWatcher by setting the resource poll frequency to NULL. This has a huge disadvantage when you're in development mode, because you'd have to restart the servlet engine each and every time you make a change in one of your HTML or other resource files.
Well - I dug into the Wicket internals and found out the ModificationWatcher was NOT meant to be plugable.. Yikes!.. Well I tried different approaches but found one that worked like a charm and it was dead simple:
Create the "org.apache.wicket.util.watch" package in your project, add a Class called ModificationWatcher and make it a copy of the ModificationWatcher from the original Wicket sources. Remove all threading but keep the base logic in the "start(Duration pollFrequency)" method.
Now override "newWebRequest" in your WebApplication class like this:
@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
getResourceSettings().getResourceWatcher(true).start(getResourceSettings().getResourcePollFrequency());
return super.newWebRequest(servletRequest);
}
and vupti you've got reload of resource files again, even on Google App Engine. Remember this is only for development, but I cant see any other ways of doing it.
And to the wicket developers - please make the ModificationWathcer extendable someway.