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

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -