The source code of Spring Petklinik, the new refer...
# spring
s
The source code of Spring Petklinik, the new reference Kotlin fullstack application I have built for my KotlinConf and Spring IO talks, is now available at https://github.com/sdeleuze/spring-petklinik. I will continue to refine it. If you want to spread the word: - LinkedIn - BlueSky - Mastodon
❤️ 11
K 8
r
Why JDK 24+ ?
s
It solves Virtual Thread thread pinning issue.
You can use Java 17+ if you don't care
That's just a recommandation
thank you color 1
t
Thank you so much for building and sharing this! ❤️ I have not seen your presentation yet, but I hope to see some things explained that I don't understand after having browsed the codebase. It took me a bit to understand that the
PetRouter
's POST handler relies on the PetDTO which is validated in the frontend code before it gets sent over the wire as FormData, in the
PetForm
. The codebase is already surprisingly simple, I'm wondering if adding a more concrete type to represent the particular FormData would help or hurt this simplicity.
s
We could indeed probably just send the
PetDTO
serialized to JSON, would you mind send a PR or create a related issue ?
t
I'll give it a shot!
thank you color 1
s
I just remembered sending POST request with fetch() is broken due to https://github.com/Kotlin/kotlinx-browser/issues/17, so maybe just create an issue as a reminder for now.
🙏 1
t
There’s also the issue that the response to the form submit is a redirect (seeOther), which we would need to manually handle in the frontend by grabbing the Location header and directing the browser to there. So I think I answered my own question: using a fetch POST with a Json type will not make the codebase simpler. 😅
s
^^