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..
Action Class
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.)
patriot indian
Greenhorn
Joined: May 20, 2009
Posts: 9
posted
0
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>.
patriot indian
Greenhorn
Joined: May 20, 2009
Posts: 9
posted
0
Can you show me a bit of working some pseudocode sort of thing so that i can use it..