reset password
Author Message
ejaan
Posts: 27
Posted 14:37 Oct 19, 2014 |

 

Dr. Sun,

 

I am stack in this problem and I need your help please.

once I Click on the Back to Item link. all the stored information in view are appearing in the listing page and the other information of the listing page are becoming null !

 

 

 

 

 

 

 

 

 

 

cs320stu66
Posts: 19
Posted 15:10 Oct 19, 2014 |

Hi,

It must be a problem with your way of storing Items data. Make sure you are storing them in the Collection such as ArrayList. And this storage must be done in your init() of DepartmentLibrary. Also check your session handling in your DepartmentLibrary and View servlet classes to store your Collection (ArrayList) data.

Hope this will be helpful.

Mohammad Yazdani,

myazdan2@calstatela.edu

lishenyu
Posts: 103
Posted 16:32 Oct 19, 2014 |
cs320stu66 wrote:

Hi,

It must be a problem with your way of storing Items data. Make sure you are storing them in the Collection such as ArrayList. And this storage must be done in your init() of DepartmentLibrary. Also check your session handling in your DepartmentLibrary and View servlet classes to store your Collection (ArrayList) data.

Hope this will be helpful.

Mohammad Yazdani,

myazdan2@calstatela.edu

by the way ,how do you store the CINs? you also store them in an arraylist? and did you use  session scopes  to pass  "id" from

view log page to check out page to view log page ? Thanks in advance!

cs320stu66
Posts: 19
Posted 17:04 Oct 19, 2014 |

Hi LISHENYU,

CIN, Name, Borrowed Date and Returned Date are attribute of another class such as CheckOut. And within the Item's class you can create ArrayList of that object (CheckOut). In this situation we have collection of CheckOuts within the Item class which can store all items CheckOut data.

You don't need to store the CIN in session you just need to pass the Item's ID using GET (like: ?id=number) from which we can track the item that is chosen by user to Edit, View or Borrow. On the other, hand we have session which is storing entire Item data in ArrayList.

Mohammad Yazdani

myazdan2@calstatela.edu

 

lishenyu
Posts: 103
Posted 22:12 Oct 19, 2014 |
cs320stu66 wrote:

Hi LISHENYU,

CIN, Name, Borrowed Date and Returned Date are attribute of another class such as CheckOut. And within the Item's class you can create ArrayList of that object (CheckOut). In this situation we have collection of CheckOuts within the Item class which can store all items CheckOut data.

You don't need to store the CIN in session you just need to pass the Item's ID using GET (like: ?id=number) from which we can track the item that is chosen by user to Edit, View or Borrow. On the other, hand we have session which is storing entire Item data in ArrayList.

Mohammad Yazdani

myazdan2@calstatela.edu

 

many thanks! could you give more details ,how do you store the CINs? Thank you !

cs320stu66
Posts: 19
Posted 22:32 Oct 19, 2014 |

Since there are many Students who are going to borrow the Library Items so we need many CIN and other details to be stored per each library item. That means we can solve the problem by creating ArrayList in the LibraryItem that can hold collection of other objects. for example: ArrayList<Checkout> checkoutList = new ArrayList<Checkout>().

And Checkout should be another model class that is having attributes such as CIN, Name, BorrowedDate and ReturnedDate

This way we can have many checkout list per one item. 

Note that LibraryItem is a model class that holds the item details such as IDTypeName and etc. which we created in Homework1.