Harry
Harry

Reputation: 4773

How to access object from session in jsp

I am trying to access a object using session scope . I am doing this in jsp

 ${sessionScope.loginBean.loginName}

but its returning empty value. Is this the correct way of accessing session variable in java class I have already set loginBean inside the session.

 session.setAttribute("loginBean",loginBean)

please help. thanks

Upvotes: 0

Views: 2107

Answers (1)

sriram
sriram

Reputation: 378

Try to run the Jsp in Debug mode and see whether the value of the loginBean is set properly.

Upvotes: 1

Related Questions