File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to retrieve a Vector of beans without using taglib ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

How to retrieve a Vector of beans without using taglib ?

Ian Yang
Ranch Hand

Joined: Nov 27, 2001
Posts: 44
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

Joined: Feb 26, 2001
Posts: 4698
    
    7

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to retrieve a Vector of beans without using taglib ?