0
<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?

peterh
  • 11,875
  • 18
  • 85
  • 108
Niks Arora
  • 45
  • 1
  • 7
  • I suggest, use clear sentences, [here](http://meta.stackoverflow.com/questions/291362/advice-for-non-native-english-speakers/291370#291370) is a quick checklist. – peterh Jul 10 '16 at 13:21

1 Answers1

0

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);  
%> 
Taha
  • 1,072
  • 2
  • 16
  • 29