Github user ageery commented on a diff in the pull request:
https://github.com/apache/wicket/pull/209#discussion_r99799884
--- Diff:
wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
---
@@ -1074,4 +1074,39 @@ public boolean getUpdateAutoLabelsOnAjaxRequests()
{
return true;
}
+
+ /**
+ * Returns a new web application.
+ * @param homePageClass Home page class
+ * @return new web application
+ */
+ public static WebApplication newWebApp(final Class<? extends Page>
homePageClass) {
+ return newWebApp(homePageClass, null);
+ }
+
+ /**
+ * Returns a new web application.
+ * @param homePageClass Home page class
+ * @param initConsumer Lambda for initializing the web application
+ * @return new web application
+ */
+ public static WebApplication newWebApp(final Class<? extends Page>
homePageClass, final SerializableConsumer<WebApplication> initConsumer) {
--- End diff --
I was thinking of the Wicket-Spring Boot library which has a dedicated
interface for this use-case [1]. From a Spring Boot perspective, I was
thinking of something building an application up like this:
@Bean public Class<? extends Page> getHomePageClass() { ... }
@Bean public SerializableConsumer<WebApplication> getWebAppInit() { ...
}
@Bean public WebApplication getWebApplication(Class<? extends page>
homePageClass, SerializableConsumer<WebApplication> init) {
return WebApplication.newWebApp(homePageClass, init);
}
[1]
https://github.com/MarcGiffing/wicket-spring-boot/blob/0c67011b887d25ffab10866016100754b204990c/wicket-spring-boot-context/src/main/java/com/giffing/wicket/spring/boot/context/extensions/WicketApplicationInitConfiguration.java
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---