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
Post a Comment