If the variable is an Array, then in jsp, I need to write both first two line(1 and 2):
1: <logic:iterate id="dish" name="dishes" type="myPack.Dish">
2: <logic:present name="dish">
3: <bean:write name="dish" property="dishName">
4: </bean:write>
5: </logic:present>
6: </logic:iterate>
then no problem. If I kill the no.2 line then jsp can't find the bean "dish". However, If the value is an ArrayList, no need to write no.2 line, it can work well without no.2 line.
Note: dishes is the variable, it can be transferred from action class in the following way: request.setAttribute("dishes",dishes1);
No comments:
Post a Comment