JSP頁面根據後臺傳值不同顯示不同內容

ZZZZVSS發表於2016-11-03

在body裡面寫一個選擇標籤


<c:choose>
	  <c:when test = "${sessionScope.user.departmentid==1}">小賣部</c:when> 
	  <c:when test = "${sessionScope.user.departmentid==2}">技術部</c:when>
	  <c:when test = "${sessionScope.user.departmentid==3}">人事部</c:when>   
	  <c:otherwise>ee</c:otherwise>
	</c:choose>

${sessionScope}是EL表示式,為的是拿到後臺傳過來的值

相關文章