Results 1 to 2 of 2
- 11-30-2010, 04:02 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 18
- Rep Power
- 0
How to get / setAttribute from a List with many sql id.
Hi. Thankś for taking the time.
Im gonna try my best to explain this. This is still new to me, and my english is as it is.
Will find/set one Customer with id 1, But what do I do if I want many? Not findAll(). Just the one's that match the sql search. Like below.Java Code:Customer customer = (Customer) customerFacade.find(1); session.setAttribute("customer",customer);
This is the best I can explain my needs without having to write a book. Hope it makes sense to you.Java Code:Customer customer = (Customer) customerFacade.find(1 and 3 and 5);
Regards / peace. Thanks again.
- 11-30-2010, 05:08 PM #2
Member
- Join Date
- Apr 2010
- Posts
- 18
- Rep Power
- 0
Ooo I think I got it.
Java Code:else if (!userPath.isEmpty() && userPath.equals("/listevents")) { String head = (String) request.getParameter("head"); String city = (String) request.getParameter("city"); String month = (String) request.getParameter("month"); String day = (String) request.getParameter("day"); List list = managerFacade.listEvents(head, city, Integer.parseInt(month), Integer.parseInt(day)); ArrayList test = new ArrayList(); Iterator it = list.iterator(); while(it.hasNext()) { test.add(eventFacade.find( it.next())); } request.setAttribute("profile", "listem"); request.setAttribute("events",test); userPath = "/profile"; }
Similar Threads
-
How do I list values of an arrays in a comma seperted list
By nmvictor in forum New To JavaReplies: 2Last Post: 11-22-2009, 05:24 PM -
How do I list values of an arrays in a comma seperted list
By nmvictor in forum New To JavaReplies: 3Last Post: 11-21-2009, 05:48 PM -
Problem with setAttribute()
By R O C K Y in forum Advanced JavaReplies: 7Last Post: 02-09-2009, 01:06 PM -
Difference between Session.setAttribute and System.setProperty
By Kavit Gamot in forum New To JavaReplies: 2Last Post: 01-27-2009, 04:11 PM -
How to access ArrayList in List of List?
By alvations in forum New To JavaReplies: 5Last Post: 10-08-2008, 12:23 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks