File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Error in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error in Struts" Watch "Error in Struts" New topic
Author

Error in Struts

amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
I am doin g project , in that I created LoginAction, ActionBean which has setter and getter meothods, one login page,one success page. Also has Struts-congig.xml,web.xml which is default created using workbench eclipse IDE....

Ths success.jsp has table wich retrieves data from DB. Which running smoothly.Mean no exception for DB connection.

The process is going like this...


login.jsp->LoginAction.java+BussinessLogic.java -->>success.jsp




The BussinessLogic.java has ArrayList productList var type....and LoginAction.java has alos has one ArrayList....?


the error was could not found productList in any scope. Can U tel me what may be tha cause...please any body....



If U r getting what I am telling can any body tel me how get the values from Data Base to form page through struts. Show me Simple application...or any page...

if replies thanks advance....


cheers
amit bhadre

[ March 15, 2006: Message edited by: amit bhadre ]
[ March 15, 2006: Message edited by: amit bhadre ]

Thanks advance who ever answers this question.


regards
amit bhadre
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The ActionForm bean should have a property (e.g. productList) that represents the list of products. Your BusinessLogic class should retrieve the data from the database using JDBC, create the list of products, and place it in the ActionForm bean using the setProductList() method. Then, in your JSP, you should be able to display the productList using either JSTL <c:forEach> or the Struts <logic:iterate> tag.

If you don't understand how to access data using JDBC, I'd suggest googling "JDBC tutorial" to understand how JDBC works.


Merrill
Consultant, Sima Solutions
 
Consider Paul's rocket mass heater.
 
subject: Error in Struts