File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes How to persist a Stateless Session Bean over several jsp pages? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to persist a Stateless Session Bean over several jsp pages?" Watch "How to persist a Stateless Session Bean over several jsp pages?" New topic
Author

How to persist a Stateless Session Bean over several jsp pages?

max zen
Greenhorn

Joined: Feb 23, 2004
Posts: 5
I wrote an application that sets the context for multiple CMP EJB in jsp pages. I had to set the context in each jsp pages. This is inefficient. So I wrote a Stateless Session Bean to persist the Entity Beans so that I can call them whenever I need. But the question is how to persist the Stateless Session Bean over several jsp pages? I set the Stateless session the first jsp page then I forward to the next page which has the code below. I get an error. I'm missing something. I need to somehow pass the fact that I am using the Session Bean again. How do I do this. Also is this jsp tag correct? Of course, I get the following error.

<jsp:useBean id="s" scope="session" type="Session" />

HTTP ERROR: 500 bean s not found within scope
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Stateless Session Bean

You seem to be suggesting you are trying to use a stateless EJB in a stateful way. Why not use a Stateful Session Bean?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
max zen
Greenhorn

Joined: Feb 23, 2004
Posts: 5
Thanks Paul for your reply... Yes, I probably don't understand Session Beans completely. But I am not maintaining any client specific information in the Bean I created. It is just being used to access entity beans and some business logic.

Are the jsp tags for Stateful Session Beans?

Also don't I have to pass something from the previous jsp page so that the receiving jsp page and get the Bean?

John
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to persist a Stateless Session Bean over several jsp pages?