Dear All, Can anyone help me how to call EJB bean deployed on Weblogic server from JSP. Actually the idea is to acccess the EJB bean thro Web Browser. Thanks in advance Muthuvel C.
After creating an instance of your bean. Either put this bean in the session or set the attribute in the request and then you will be able to use this bean in your jsp. ------------------
Originally posted by Muthuvel Chinnachamy: Dear All, Can anyone help me how to call EJB bean deployed on Weblogic server from JSP. Actually the idea is to acccess the EJB bean thro Web Browser. Thanks in advance Muthuvel C.
You will have to first include the bean that is going to used in that JSP. I am giving an example here. I had prepared a package which contains all of the Beans. Just add this line with all of the other imports. <%@ page import = "user.*" %> "user in my case was the name of that package". Get the initial context.. InitialContext ctx = (InitialContext)EVUtil2.getInitialContext(); Look up the home.. user.RegisterUserHome regUserHome = (user.RegisterUserHome)ctx.lookup("RegisterUserHome"); Create the remote.. RegisterUser regUser = regUserHome.create() ; Get the data from the method present in that bean VectormemGroups = regUser.MemberGroups(OrgID, userId); (Here MemberGroups(OrgID, userId) is one of my methods defined in that bean and expects two inputs OrgID, userId and returns memGroups vector.) Show the information... use the returned data type to show information.
Enjoy.
Originally posted by Muthuvel Chinnachamy: Dear All, Can anyone help me how to call EJB bean deployed on Weblogic server from JSP. Actually the idea is to acccess the EJB bean thro Web Browser. Thanks in advance Muthuvel C.