groovy - grrovyTest$_run_closure1_closure3_closure4_closure5@4d1abd getting displayed under div while generating html -


i value when try generate html using groovy, here code , output below

code:

import groovy.xml.markupbuilder println("let try html page..\n") def mkp= new markupbuilder() mkp.html{head{ title "bijoy's groovy"     body{         div{style:"color:red"}             {p "this cool"}     }}} 

and output has grrovytest$_run_closure1_closure3_closure4_closure5@4d1abd extra.. how remove it?

 <html>       <head>     <title>bijoy's groovy</title>     <body>       <div>grrovytest$_run_closure1_closure3_closure4_closure5@4d1abd         <p>this cool</p>       </div>     </body>   </head> </html> 

attributes dom element mentioned in () map representation shown below <div>.

import groovy.xml.markupbuilder println("let try html page..\n")  def writer = new stringwriter() def mkp = new markupbuilder(writer) mkp.html{    head{        title "bijoy's groovy"    }    body{       div(style:"color:red"){          p "this cool"       }    } }  println writer 

also note, rectified head , body , added writer. suppose not want body inside html head. :)


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -