This is a follow up to my original post.
We have 3 use-cases of JSP in our legacy app:
Simply using JSP as a template language to transform DTOs into HTML snippets. Very small amount of logic/java in the JSP page.
The conversion process was very painless because Kotlin classes appear to Java as JavaBeans and work seamlessly from JSP.
Same use-case as #1 but with much more complex logic (in the form of JSTL logic tags or java-in-the-jsp) to transform the DTOs into HTML.
For these pages, I replaced the JSP with [Kotlin HTML Builder (https://github.com/Kotlin/kotlinx.html). This was a wonderful experience. In the future I plan to convert all server-side HTML generation to this technique.
HTTP Handler. As a general way to create server-side http handlers that serve up JSON. (I have always thought this is a highly underrated technique for creating REST APIs with no additional frameworks.)
This was also painless, because most of the JSP pages look like this:
<% processCustomerRequest(request,response); %>
Where processCustomerRequest is written in Kotlin.