<https://github.com/eugenp/tutorials/blob/master/s...
# announcements
g
https://github.com/eugenp/tutorials/blob/master/spring-mvc-kotlin/src/main/kotlin/com/baeldung/kotlin/mvc/ApplicationWebConfig.kt I'm having an issue following that. Not sure where to put it and some of this stuff is depreciated. I've got a REST API in main.kotlin.org.app.web.api.apiController and I'm trying to make main.kotlin.org.app.web.js.jsController; basically my @RestController is working perfectly but I can't seemt o get my HTML/js @Controller to work. I was thinking the view resolver needed to be configured or something? New to kotlin, spring boot and smart IDE development.
https://spring.io/guides/tutorials/spring-boot-kotlin/ I've gone thru this tutorial and others too... basically I think I need to configure a view resolver and I'm not sure how
Giving up... I've tried 4 or 5 frameworks, nothing I do seems to allow spring to server up html, not a thing.
g
Maybe #spring is better place for this question
c
Place html files in
src/main/resources/static
You could break it in Web config. Have you added any custom web configuration? PM me
g
I've kind of come to the conclusion that spring boot and kotlin is great for creating rest APIs but probably terrible for the front end stuff. I'm trying a new approach... before I was attempting to make everything (server, browser, iOS app, android app) with kotlin in a single project... now I'm thinking totally differently... I'm thinking spring boot + kotlin for the rest API, Angular CLI for the browser and probably something just as specialized for the iOs and Android software... all 4 as their own isolated projects.
c
You be surprised how far you can go with Angular and then doing the manifest and service worker for a PWA.
g
yeah? I think I've been going about this new project wrong... I'm a more fundamental coder than big package coder, I think C++ over Java for example... I really hate when my application is 500MB in size before I write my first piece of could because of frameworks, that scares the hell out me. But I'm attempting to write this app differently, the modern way... the coolest most ideal way if that makes sense. Kotlin looked cool as hell because it claimed to compile natively to all three platforms, but although it may be possible it doesn't seem practical anymore... too new, not enough packages to expedite, far better ways available to do the certain pieces... this, I'm trying to completely change my approach... am i crazy?
lol
c
Kotlin Native is still in beta.
By using Kotlin on JVM you will be able to use Graal to create native images.
g
yeah? I know nothing about graal but will definitely take a look, thanks. In a sea of to many overlapping tools and packages, I tend to try to minimize which I use... trying to break that habit with this app.
c
Kotlin + Spring will be a new experience but there is a lot of info available. You need to be aware of the difference between Spring WebMVC and Spring WebFlux MVC is based on Java Servlet specification while WebFlux is a reactive framework leveraging Reactive Streams specification. Reactive provide huge scalibity at the cost of some extra work and a slightly different mental model.
The two do not go together.
g
Spring WebMVC and Spring WebFlux?
c
Better to start with simple non-reactive stuff like Spring MVC and Spring Data JPA or Spring Data JDBC
The reactive and non-reactive models don't mix.
When you look at samples make sure to determine which they are targeting.
g
I've had issues with kotlin and gradle, stuff seems to be changing so fast that online document is mostly obsolete. Gradle kts is still kickin my butt. I ended up making the entire rest api very fast with spring boot and kotlin and exposed... should I replace exposed with spring boots DB connector before I get too far? Probably. So hopefully this next phase will work out, two projects, springboot/kotlin and another project for angular cli... then I gotta decide on the mobile apps.
c
exposed?
g
kotlin-exposed... started with it before I got into spring, its a kotlin DB connector
was originally thinking this would all be pure kotlin jvm and/or native but that seems impractical now.
c
Yes it will be easier to stick to an ecosystem, either ktor + exposed or Spring MVC / JDBC / JPA you can also look at jOOQ dependencing on the abstraction you want for your database.
What is the range of technical usecases you want to implement? Ktor and exposed might be able to do the job.
g
yeah, I was considering ktor+exposed+kotlin-react+kotlin-styled. I'm basically making an rss feeder reader (rome package looks best for that part)... it'll send the parsed feeds to mobel apps and browser
c
If you want to blow your mind fire up JHipster and let it generate a Spring + Java or Kotlin application
g
Interesting...
AHhhhhhh!!!!! too many tools!
c
Kotlin on Android and on JVM is mature and because of a frictionless integration with Java there is a lot of tools available.
The Kotlin DSL for Gradle is still kicking my but and I have been using Gradle since before 1.0
g
that's good to know, thanks.
wanna take a look at mine ­čśâ???
c
The learning never stops
g
yeah, thanks for the help and emmotional support my friend
c
Shout when you need a shoulder to cry on
g
will do!