I am working on an simple application which use Spray and Scala and I am beginner in this environment. I am working on a form which is used to send information through post method. Form is below
lazy val formPage =
<html>
<body>
<form id="register">
<fieldset>
<legend>Dodaj sędziego</legend>
<div>
<label>Imię
<input id="first-name" name="first-name" placeholder="Imię" required autofocus>
</label>
</div>
<div>
<label>Nazwisko
<input id="last-name" name="last-name" placeholder="Nazwisko" required autofocus>
</label>
</div>
<div>
<label>Numer identyfikacyjny
<input id="number" name="number" required>
</label>
</div>
</fieldset>
</form>
</body>
</html>
and I call it
path("judge" / "new"){
respondWithMediaType(`text/html`) {
complete {
formPage
}
}
}
and it causes a lot of problems during compilation, for example:
[error] /project/src/main/scala/pl/vectorotic/MyService.scala:45: in XML literal: '=' expected instead of 'a'
[error] <input id="first-name" name="first-name" placeholder="Imię" required autofocus>
I would like to ask how to use html inside scala program.