You have:
package kotlin.browser
Name | Summary |
---|---|
_document | private val _document: Document |
document | Provides access to the current active browsers DOM for the currently visible page.public val document: Document |
buildscript { | |
version = '0.1-SNAPSHOT' | |
repositories { | |
mavenCentral() | |
maven { | |
url 'http://oss.sonatype.org/content/repositories/snapshots' | |
} | |
} | |
dependencies { | |
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.1-SNAPSHOT' |
fun setDate(year: Int, month: Int, day: Int): Date { | |
val cal = Calendar.getInstance() | |
cal.set(year, month - 1, day); | |
return cal.getTime() | |
} | |
data class Customer(val id: Int, val name: String) | |
val getPersons = routeHandler { |
val http = EasyHttp() | |
http.get("http://localhost/customers", callback = { | |
assertEquals("joe", asJson("results.customers[10].name")) | |
}) |
fun myFunc(f: T-> Any) = f | |
val something = myFunc { | |
} |
fun plus(number1: Int, number2: Int): Int { | |
if (zero(number2)) { | |
return number1 | |
} else { | |
return (add1(plus(number2, sub1(number1)))) | |
} | |
} |
buildscript { | |
ext.kotlin_version = '0.1-SNAPSHOT' | |
repositories { | |
mavenCentral() | |
maven { | |
url "https://oss.sonatype.org/content/repositories/snapshots" | |
} | |
} | |
dependencies { | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
val appServer = AppServer() | |
appServer.get("/", { | |
response.send("Hello!") | |
} | |
appServer.start() // port 3000 default | |
import javax.servlet.http.HttpServlet | |
import javax.servlet.http.HttpServletRequest | |
import javax.servlet.http.HttpServletResponse | |
import javax.servlet.annotation.WebServlet as web | |
import javax.inject.Inject | |
import javax.enterprise.context.Dependent | |
web(name = "Hello", value = array("/hello")) | |
public class HomeController : HttpServlet() { |
import javax.servlet.http.HttpServlet | |
import javax.servlet.http.HttpServletRequest | |
import javax.servlet.http.HttpServletResponse | |
import javax.servlet.annotation.WebServlet as web | |
import javax.inject.Inject | |
import javax.enterprise.context.Dependent | |
web(name = "Hello", value = array("/hello")) | |
public class HomeController : HttpServlet() { |