java - Generate fragments of html view template in Play Framework -


i know how generate html in java, , pass view using parameter. how can achieve this?

i've searched official play framework documentation, nothing found it.

i know possible because can pass 1 template using variable.

in case generate view on java. f.e. create method display in inherited classes generate ready use html code.

please help

playframework 2.2.6

why won't use play.twirl.api.html?

your action:

public result youraction() {     html myhtml = new html("<h1>it works out of box</h1>");     return ok(yourview.render(myhtml)); } 

yourview.scala.html

@(myhtml: html)  code: @myhtml 

works out of box, @ least play 2.3+


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -