Reloading pages in Wicket

Posted on August 7, 2009. Filed under: Java | Tags: , , , |

When developing software, and especially web frontends, is nice and handy to get some immediate feedback on the work you’ve done, without having to rebuild all dependent projects, killing servers, redeploying wars, etc.

At my current project, we have a simple web frontend which is using Wicket, which needs some changes now and then. Unfortunately, Wicket doesn’t reload pages out of the box, and you need some to make this work.

What is recommended to do (but not required), is to set Wicket in development mode. This can be done in multiple ways, but I’ve set the System property ‘wicket.configuration’ to ‘development’. Then, by changing some code in the WicketApplication (which extends WebApplication), you can enable the hot reloading of resource files. The following code is required for that:

String configurationType = getConfigurationType();
if (DEVELOPMENT.equalsIgnoreCase(configurationType)) {
  log.info("You are in DEVELOPMENT mode");
  getResourceSettings().setResourcePollFrequency(Duration.ONE_SECOND);
}

This way, by recompiling the classes, Wicket detects the changes to HTML and will reload them for you, without having to redeploy the whole application, or needing to restart Jetty. Nice!

References

Wicket FAQ


Read Full Post | Make a Comment ( 1 so far )

Recently on Don’t mind the language...

The First NLGUG Meetup

Posted on May 16, 2009. Filed under: NLGUG | Tags: , , , , |

ActiveMQ NullPointer exceptions when creating objectmessages.

Posted on March 24, 2009. Filed under: Java |

Dutch Groovy and Grails User Group

Posted on March 16, 2009. Filed under: NLGUG | Tags: , , , , |

Groovy PowerPoint DSL

Posted on February 27, 2009. Filed under: Groovy | Tags: , , |

Converting Groovy Objects to JSON using Grails

Posted on February 14, 2009. Filed under: Grails, Groovy, Uncategorized | Tags: , , , |

IntelliJ JSON Formatter Plugin 0.2

Posted on February 14, 2009. Filed under: IntelliJ JSON Formatter Plugin | Tags: , , , |

IntelliJ JSON Formatter Plugin

Posted on February 5, 2009. Filed under: Grails, IntelliJ JSON Formatter Plugin | Tags: , , , , , |

6 ways how Mac OS Finder could be improved

Posted on December 14, 2008. Filed under: Mac OS | Tags: , , |

Cut and Copy in Mac OS X Finder

Posted on December 12, 2008. Filed under: Mac OS | Tags: , , , , , , |

Installing Tomcat 5.5 or Tomcat 6 on OpenSolaris

Posted on December 4, 2008. Filed under: Open Solaris |

    About

    Erik Pragt’s blog about all things language related.

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...