Tuesday 20 August 2013

JSTL Foreach not working

JSTL Foreach not working

i am new to java j2ee. i am writing some code to print user list in jstl
foreach. but it is not working. it is not printing any thing here is my
code
<%
ArrayList<User> list = new ArrayList<User>();
User user = new User();
user.setUsername("usman");
user.setPassword("123");
list.add(user);
%>
<c:forEach items="${list}" var="user">
<c:out value="${user.username}"></c:out>
<c:out value="${user.password}"></c:out>
</c:forEach>
please help me!

No comments:

Post a Comment