Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vinod Vinu
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic