questions about the use of Java Beans


EJB programming & troubleshooting: questions about the use of Java Beans

  1. questions about the use of Java Beans (1 messages)

    I know Java Beans can be defined in a scope of page, request, session or application, and it exists as attributes of scope object.
    I'm using MVC model, when servlets invoke EJBs to get the data, it puts data into the attributes of the scope Object(like session or request), and forward it to JSPs, the JSP then access the scope objects to display data.

    I wonder, since Java Bean defined like <jsp:useBean id='..' class='...' scope='session'> still exists in session object, do I need to just use this tag to get the Java Bean instance in Session Object or instead access the session object to get the Java Bean?

    any help appreciated!!!

  2. You can use <jsp:useBean .../>. Of course, you can also access the session object directly.