• Post Reply Bookmark Topic Watch Topic
  • New Topic

x JSP's use one EJB ?????  RSS feed

 
Hrvoje Canzek
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi together,
i have different JSP Sites and all should use "the same" stateful session bean, how can i realize that?
thank you
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "JSP sites", do you mean different web applications running on the same server?
Simon
p.s. please don't post questions in more than one forum - it's unecessary since most readers visit more than one forum anyway
 
Hrvoje Canzek
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
every JSP is part of one application and every JSP makes a lookup to find the bean.
Code example of every JSP:
---------------
<%! private Cart mybean = null;
public void jspInit()
{
try
{
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("TheCart");
CartHome home = (CartHome)
PortableRemoteObject.narrow(objRef,
CartHome.class);
mybean = home.create();
}
catch (Exception ex)
{
System.out.println(ex);
}
}
%>
---------------
Step example: The first JSP makes a DB-Connection
and the second JSP(click in menu) should display the Table XY, the 3rd JSP makes an Insert into the table, and so on.
How can i implement this,so that this application uses one Stateful Session Bean. IS IT POSSIBLE???
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!