Print Java variable onto JSP page -
i having trouble printing java variable created in java bean on jsp page. tried calling method java bean jsp receiving syntax error , using current knowledge figure out.
public class studentloginbean { @managedbean( name="studentloginbean" ) public string username; public string getusername() { return username; } public void setusername(string username) { this.username = username; }
this tried.
<% string username = studentloginbean.getusername("username"); %> <div class="margintable" data-pubid="<%=username%>" data-count="5"></div>
kindly add scope of bean viewscoped, sessionscoped etc
@viewscoped
@managedbean( name="studentloginbean" )
hope work. thanks
Comments
Post a Comment