<% out.println( bc.getUserid()); %> I want to access the methods in my bean class Cr" /> <% out.println( bc.getUserid()); %> I want to access the methods in my bean class Cr" /> <% out.println( bc.getUserid()); %> I want to access the methods in my bean class Cr"/>

Why I am unable to access the values of methods in a Beanclass?

27 views Asked by At
<jsp:useBean id="bc" class="com.go.Credentials" scope="session"/>
<%
     out.println( bc.getUserid());
 %>

I want to access the methods in my bean class Credentials. When I am trying to do so, I am getting null. Why?

1

There are 1 answers

0
Taha On

you get id value with

<jsp:getProperty name="bc" property="id"/>

or If you want scriplets

<%  
int value=bc.getUserid();  
out.print("user ID is : "+value);  
%>