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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -