wood burning stoves 2.0*
The moose likes JSP and the fly likes Jsp:useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp:useBean" Watch "Jsp:useBean" New topic
Author

Jsp:useBean

jaffrin abdul salam
Greenhorn

Joined: Sep 16, 2005
Posts: 23
<jsp:useBean id="VRF_LIST" class="java.util.ArrayList" scope="request"/>

I am using the above line in one of my jsp page.
If the scope is request then,
is it possible to get VRF_LIST object from "request.getattribute("VRF_LIST")" that has been set in EJB.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

Originally posted by jaffrin abdul salam:

is it possible to get VRF_LIST object from "request.getattribute("VRF_LIST")" that has been set in EJB.


No, that would result in a compilation failure. If however, you use:



it would work as long as the EJB set the scoped variable on the same request.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jaffrin abdul salam
Greenhorn

Joined: Sep 16, 2005
Posts: 23
Thanks!
Bear Bibeault
jaffrin abdul salam
Greenhorn

Joined: Sep 16, 2005
Posts: 23
VRF_LIST is set on EJB Like
request.setAttribute("VRF_LIST",vrflist);
vrflist is a map.This variable is set on same request.

And In the JSP I am Using
<jsp:useBean id="VRF_LIST" class="java.util.ArrayList" scope="request"/>
int size = VRF_LIST.size();

DO i have to still use
request.getattribute("VRF_LIST"); to get the attribute.?
Or It is not necessary to get the attribute usig the above line.
-------------------------------------------------------------------------
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

It will not be necessary; the <jsp:useBean> action will hook up the scripting variable populated with any existing scoped variable of that name in the request.

Again, this all depends upon whether the EJB is putting the scoped variable in the same request that your JSP page is serving.
 
Don't get me started about those stupid light bulbs.
 
subject: Jsp:useBean