Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

How to retrieve a Vector of beans without using taglib ?

 
Ian Yang
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello,
I have a "MyServlet.java", "My.jsp" and "ItemList.java" which is a bean class. First "MyServlet.java" handles some business logic and then feeds a Vector of items into "ItemList" bean and creates a vector of Litemlist bean, then do
request.setAttribute("ItemListVec", v);
and forward(request, response) to "My.jsp".
Question is-- In "My.jsp", if I don't use taglib, and just want to use <jsp:useBean> <jsp:getProperty> syntax, how can I retrieve the ItemList vector ? The "id" in jsp:useBean is associated with the vector, not element, and this "id" matches to "ItemListVec". How do I get info. from each element ? what "id" should I use when I retrive element ?
I know I can do in a similar way by simply do:
request.getAttribute("ItemListVec");
then loop through it and get the info from each element. But in this way, I am NOT using <jsp:useBean> <jsp:getProperty> syntax, am I still using MVC ?
thanks,
Ian
 
Junilu Lacar
Bartender
Posts: 7481
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Reply here: http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=50&t=000651
Ian,
Please do not cross-post. This thread will be closed.
Thanks for your cooperation.
Junilu
 
    Bookmark Topic Watch Topic
  • New Topic