Open kutoman opened 6 years ago
Correct me if I am wrong but I don't see any value of using ktor with Wicket. Can't you simply use Kotlin with Wicket with no ktor? Why combine?
imho there is a value. My server has to provide both a web ui (for my backend) and a well documented api (for frontend clients). By using ktor it's pretty easy for me to implement the api and document it (by using ktor-locations and swagger). I think this is not straightforward in wicket. But on the other hand wicket is a good fit for creating the web ui. Its component based nature makes the ui easy to maintain which is missing in ktor. Hence a combination would help me alot.
I found out that the wicket application can be run without a web.xml. Thus, if possible, I just would need to add the application as a HttpServlet to ktor.
I've got this here:
embeddedServer(Jetty, 8080, configure = {
configureServer = server@ {
this.handler = WebAppContext().apply {
server = this@server
contextPath = "/"
war = "src/main/webapp"
}
}
}) {
install(DefaultHeaders)
install(CallLogging)
}.start(true)
this is of course not working, since the handler gets replaced by a JettyKtorHandler
later on before the server gets started. Any possibility to have multiple handlers here, or do I have to write my custom engine?
Note: unfortunately I can't reuse JettyKtorHandler
since it's an internal class. Thus implementing a customized ApplicationEngine won't work without a lot code duplication.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
I would like to use Apache Wicket's component based approach in a ktor server. I'm trying to integrate a wicket application which should make my web ui component based in an embedded ktor server but I'm not sure how to manage this. Here is the code I would like to combine with a io.ktor.server.engine.embeddedServer call (if it's possible)