Change <label> text via <% JSP %> -


<label id="maintext" ></label>      <%       out.println(mainblog.gettext()); %> 

how can connect maintext label mainblog.gettext() element?

thanks.

<label id="maintext" ><%=mainblog.gettext()%></label> 

this work. it's not practice mix java code in jsp.

ideally should set mainblog bean in request scope in java controller attribute

request.setattribute("mainblog",mainblog); 

and use in jsp using expression language

<label id="maintext" >${mainblog.text}</label> 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -