Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
max zen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
max zen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic