http://stronglytypedblog.blogspot.com/2009/04/wicket-on-google-app-engine.html 2. Add Wicket jars Add the following jars to the war/WEB-INF/lib directory and add them as external jars to the eclipse project:- wicket-1.3.5.jar - slf4j-api-1.5.2.jar - slf4j-log4j12-1.4.2.jar - log4j-1.2.13.jar 3. Turn on logging Turn on logging, so that you can see any strange things, that may occur. App Engine won't tell you much by default. - log4j.properties: log4j.logger.org.apache.wicket=DEBUG, A1 - java6 logging.properties: .level = INFO 4. Create a Wicket Application and a Page Add WicketApplication.java
and a simple HomePage.java and HomePage.html :
5. Set up WicketFilter Add the Wicket servlet filter to web.xml . Alternatively use WicketServlet :
6. Add HTTP session support Enable HTTP session support (by default it's disabled) by adding the following line to appengine-web.xml :
Now the app is ready to run, but there are still some issues. 7. Disable resource modification watching When Wicket is started in development mode now, exceptions are raised because Wicket spawns threads to check resource files such as HTML files for modifications. Let's just disable resource modification checking by setting the resource poll frequency in our WicketApplication 's init() method to null .
8. Disable SecondLevelCacheSessionStore We cannot use the SecondLevelCacheSessionStore in the app engine, which is the default. At least not with a DiskPageStore , because this serializes the pages to the disk. But writing to the disk is not allowed in the app engine. You can use the simple HttpSessionStore implementation instead (this increases HTTP session size), by overriding newSessionStore() in our WicketApplication :
9. Run From the context menu of the project, call Run As -> Web Application . Open http://localhost:8080/wicket/ in your browser and see the app running.Download the demo as an eclipse poject. |