This week's book giveaway is in the Testing forum. We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line! See this thread for details.
i am a newbie to struts...currently using 1.1 version...i was trying to retrieve the data from database onto my jsp page but am having trouble...please help me out...i have a database and i have to retirve values form there into my jsp page ...here is what i am doing..
The property is "proposerId" (note that the first character isn't capitalized).
I'm almost positive this isn't how you want to do it though--you're creating a collection of ActionForms. Normally there's a single ActionForm per action, and the ActionForm is passed automatically to the JSP. In y our case you'd have a list of users in the ActionForm, not a list of ActionForms.
(There is some debate whether or not ActionForms should be used solely for form data, or for *any* data for use on the page--I am of the former camp, but that's preference.)
hey thanks for the quick reply...but can you tell me how to solve this problem ...i need to get the entries from the databse into my jsp page...how exactly we will do that...currently i am able to pass the object into the arraylist...now i need to get the attributes(methods) to display them on the jsp...
You should be able to either add DB entries to a list (an array should also work) in an ActionForm, or create a separate collection and put it into request scope. From there use <c:forEach> (recommended) or if you're not using JSTL <logic:iterate>.