aspose file tools*
The moose likes Beginning Java and the fly likes Storing into a list from a model for a 'specific status' only ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Storing into a list from a model for a Watch "Storing into a list from a model for a New topic
Author

Storing into a list from a model for a 'specific status' only ?

Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
hi, on a jsp there are two checkboxes : -

Ordered
Not Ordered

since such no fields are there in a actual table of a db. Iam getting a complete list irrespective of the status which is getting stored in a resultModel of the form.

Now iam able to get that data from a model and place it on jsp of differnt model. But all the records are getting shown.

I want to filter it by the status.

what i want from you guyz is to just give me some hint on it.

i want to take data from model and store it in a list first like:-


and it printing for Ordered only.
But how to store it inside the list which contains 'specific status' data and then print it on jsp

any idea ?


Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
That looks pretty disastrous, using == to compare Strings, and creating a new List as a local variable inside the "if" block.

And please be careful about spellings; some people who didn't learn English as children may have difficulty with "guyz".
Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
That looks pretty disastrous, using == to compare Strings, and creating a new List as a local variable inside the "if" block.


i know it is not a good idea to compare two such strings but i was doing this just on temporirly basis but actual implementation will done later.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
Your temporary code will find its way into production code; because you have omitted correct practice at this stage you will have much more work sorting it out later.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing into a list from a model for a 'specific status' only ?
 
Similar Threads
Is my MVC design under RMI reasonable?
how to connect legacy system using java?
compiling help
For Getting Distinct value (In Struts2)
Should we use DefaultTableColumnModel with TableModel ?