jsp - Passing List from controller to view with JSTL or EL -
I would like to switch EL or JSTL from script, but I can not understand how you can view in your view passes Controller
We say that our controller has a list of cars, and we want to display them on our scene. With the authors we will:
& lt;% list & lt; Cars & gt; Cars = (list) request.getAttribute ("car"); & Gt%;
Div class = "post-text" itemprop = "text">
I'm assuming that you are defining your list with your controller -
request.setAttribute ("item", item);
If this is the case, then you can access each item in this list as follows -
If there are assets in the list that have the property, say, value
(which means that you have getPrice
in the class You can do this to access that value -
$ {item.price}
inside of that jstl loop .
Comments
Post a Comment