Using objects as select options in Vue.js is straightforward. Together with the v-for directive you create the options as follows:
<select v-model="selected"> <option v-for="acc in accounts" :key="acc.id" :value="acc">{{acc.name}}</option> </select> Binding the value attribute to the object itself and the option’s text to a key in the object. You can use VeeValidate on select as well:
<select v-model="selected" required v-validate></select> Adding a noSelection option A default (noSelection) option can be added by having an option bound to null in the option list.
This post will show how to use a HikariCP JDBC connection pool in a Grails 3 application. By default, GORM for Hibernate uses a Tomcat JDBC connection pool when you bootstrap your app using grails' create-app command. Switching to HikariCP is simple. Remove the Tomcat JDBC dependency in build.gradle```` runtime "org.apache.tomcat:tomcat-jdbc" ```And replace it with the HikariCP dependency as follows:``` runtime "com.zaxxer:HikariCP:3.2.0" ```Just like Tomcat JDBC, HikariCP config properties can be set in application.
In this blog post, the first part of the Spring Boot Admin series, I will illustrate how to use Spring Boot Admin to monitor and manage a Grails application.
1. Setting up the Spring Boot Admin Server The getting started guide clearly explains how to setup an admin server. This basically involves creating a simple Spring Boot app and adding the SBA server dependency:implementation('de.codecentric:spring-boot-admin-starter-server:1.5.7')Since grails in built on top of spring boot 1.
Continuing from my previous post on combining the server and client projects of a grails vue profile app into a single executable jar file, you can make use of the heroku-gradle plugin to deploy the resulting jar to Heroku. The tutorial here can help get started with deploying gradle projects to Heroku. Prior to using the plugin you would need to take the following steps to deploy.
Define your Procfile with the command to execute the web app``` web: java -Dserver.
When working with the Vue profile in grails it creates a multi-project build with server and client projects. Grails offers documentation on how to combine the two into a single deployable jar. You create a top level build.gradle file with a task to copy the contents of the client build folder into the server resources folder.
However, since Webpack bundles your client app into the dist folder, the tutorial will not work as it is.
In this post I will illustrate how to use NamedParameterJdbcTemplate with multiple datasources in a Spring Boot 2.0.5 application. It expands on the spring guide available here.
1. Define the datasource properties Add datasource properties to application.properties for each datasource to be configured.``` #db1 datasource db1.datasource.jdbc-url=jdbc:mariadb://localhost/datasources_db1 db1.datasource.username=root db1.datasource.password=
#db2 datasource db2.datasource.jdbc-url=jdbc:mariadb://localhost/datasources_db2 db2.datasource.username=root db2.datasource.password= ```Note that with Hikari on the classpath we need to replace the url property with jdbc-url as Hikari does not have a url property.