Removing a stateful session bean from client code
I required your help in developing my J2ee based applicatin in which I am
using 3-tier architecture. My page flow is as following,
Login.jsp
(in which he gets id and password and create stateful session bean and pass
these parameter to SFSB business method that method calls create local BMP
entity bean and pass those id and password to entity bean business method
and then get result and return back to jsp page in that page I set two session
variable one is based on database result which we get on behalf of id and password
and other is my remote object of SFSB, then i go to next page Home.jsp)
Home.jsp
(in this page I get session objects and display some result and in this page I have a link of logout.jsp
page when user click that link it goes to logout.jsp page)
logout.jsp
(the code of that logout.jsp page is)
<%
try{
akdtradedemon.UserSesion us=(akdtradedemon.UserSesion)session.getAttribute( "usersesion");
us.remove();
}
catch(Exception e)
{
e.printStackTrace();
}
session.invalidate();
out.println("You have sucessfully log out");
%>
Question:
My question in this regard is that whether I should remove SFSB here by myself it is good technique or container
should do this to me any thing about this code any suggestion or code u refer to me will be very helpful for me
please reply
From Noman Ahmed
Appxs Ltd.
|