This is not a strictly Velocity question, but putting it here because I believe that I'd be able to get good inputs here.
I use Velocity as view, and struts for actions. Now I have several actions which search DB for various searches and produce a list. I have single velocity template "results' to which all these actions are forwarded. Now let's say I have a list of books which can be searched on various parameters and various actions are defined for these searches. Now I need to display only those books which satisfy condition - isAvailable (actual list and condition is far more complex) and not otherwise. I have 2 approaches - (1) Put a conditional check in velocity template while iterating though a list to decide if the book should be displayed. It would be sth like this - #foreach($book in booklist) #if($StockManager.isAvailable($book.number)) ## do whatever here... #end ## don't display anything if book is not available #end (2) Another approach is to check this in VARIOUS actions while creating the list itself if the book should be added to the list at all. First approach sounds easier to implement, but it means that the view part is taking decision about business logic, which sounds "not so nice" Second approach is difficult because there are many actions that will have to be changed, besides there are many programmers working on various actions, so they all need to take care of that. So I am trying to avoid this.... However, there's one more advantage here, if I do it this way I can add a unit test to check that only "available" books are getting added. What should be the best approach in this case, it's not just about getting this done somehow. I'd highly appreciate any inputs here. TIA, - Manish p.s. BTW, is there anything similar to Java "continue" in VTL? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]