Reputation: 328774
I've started to work with Wicket. When I make changes to the HTML templates, that becomes visible right away.
But when I make changes to the code, I need to restart Jetty. I'm running in DEVELOPMENT
mode (at least that's what the big fat warning in the log says) and I have installed the ReloadingWicketFilter
as per this question: Wicket - runtime class reloading
My guess is that this behavior is because I make all changes in the constructor of my pages and Wicket doesn't create a new page when I reload.
I've browsed the Wicket examples but there is no example which shows how to build a Wicket page without adding all components in the constructor or how to tell Wicket to create a new page for every request or how to tell Wicket to create a new Page.
Upvotes: 3
Views: 1611
Reputation: 364
In IntelliJ, run the Start application through debugging. As you make changes to Java and compile, IntelliJ reloads the class through HotSpot. The changes become available in your application.
You are of course limited to HotSpot"s limitation of only being able to (for example) create new classes and change method bodies.
Upvotes: 0
Reputation: 17375
I am using mvn jetty:run and this config in the pom.xml:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<!-- to be used in combination with netbeans compile on save feature -->
<scanTargets>
<scanTarget>target/classes/</scanTarget>
</scanTargets>
<scanIntervalSeconds>1</scanIntervalSeconds>
</configuration>
</plugin>
And my IDE (NetBeans) is configured that it compiles on save... then I can make a change switch to the browser and hit reload ... and the changes were applied + jetty was reloaded
Or use the commercial app jrebel
Upvotes: 4
Reputation: 2694
I think that last paragraph can be addressed by overriding Component's onInitialize() method.
See http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#onInitialize()
Regards,
Marek
Upvotes: 0