【发布时间】:2015-03-14 03:24:58
【问题描述】:
我想在“我的个人资料”模式中显示来自数据库的用户详细信息。我在 login.jsp 页面中使用 JSTL。这是我尝试过的(以及其他一些变体),但没有任何结果。数据库连接正常!。表名是users,我想在表中找到合适的用户。当有效用户登录时,我会收到来自 index.jsp 的请求 username。
<c:forEach var="user" items="${users.rows}" >
<c:if test="${username}" == "${user.username}"> // <-- This is NOT working!
如果 username 和 ${user.username} 匹配,那么我想在模态中显示用户的信息,例如:
<c:out value="${user.fullName}"/>
<c:out value="${user.occupation}"/>
<c:out value="${user.email}"/>
<fmt:formatDate type="both" dateStyle="short" timeStyle="short" value="${user.joined}"/>
【问题讨论】:
标签: database jsp servlets jstl