JSP

[JSTL] list size jsp로 출력하기

유호야 2021. 8. 28. 18:57
반응형

역시 stackoverflow 없는게 없다.

그냥 ${list.size} 하면 나올 것 같지만, 나오기를 희망하지만

그렇게 호락호락하지 않는 것~

먼저 태그 라이브러리 입력해야 하고 

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

${fn:length(리스트명)}
//예시 ${fn:length(requestList)}
 

get the value of a List.size() in a JSP page?

This is a simple question, I should know the answer and I'm ashamed to admit I don't. I am sending a compound object to my JSP page: public class MyObject { private List myFoo; ...

stackoverflow.com

 

반응형

'JSP' 카테고리의 다른 글

ajax HashMap 넘기기  (0) 2021.02.02
${page_num +1}  (0) 2021.01.26
댓글달기 script 부분  (0) 2021.01.23
JSTL 문자열 비교하고 싶을 때  (0) 2021.01.15
[JSP&Servlet] Scope - Page, Request, Session, Application  (0) 2020.12.04