Kotlin Portlet

The Kotlin Portlet sample provides an input form that accepts a name. Once submitting a name, the portlet renders a greeting message.

Figure 1: After saving the inputted name, its is displayed as a greeting on the portlet page.

Figure 1: After saving the inputted name, it's is displayed as a greeting on the portlet page.

What API(s) and/or code components does this sample highlight?

This sample highlights the use of the Kotlin programming language in conjunction with Liferay’s MVC framework. Specifically, this sample leverages the MVCActionCommand interface.

How does this sample leverage the API(s) and/or code component?

This sample uses the MVC Action Command’s processAction(...) method to process the inputted text (i.e., name). The text is set as an attribute in the KotlinGreeterActionCommandKt.kt class using an ActionRequest and then is retrieved in the JSP using a RenderRequest.

Where Is This Sample?

This sample is built with the following build tools:

« Greedy Policy Option Applicationnpm Samples »
Was this article helpful?
0 out of 1 found this helpful