thg303
پنج شنبه 07 بهمن 1389, 00:57 صبح
سلام؛
این سورس فایل jsp من هستش:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>A JSP Page With Parameter Looping</title>
</head>
<body>
this is it! <br>
<c:forEach begin="1" end="5" step="1">
This is from inside the loop.<br>
</c:forEach>
<c:out value='$header["host"]}' />
<c:out value="${10 mod 4}" />
<br>
<c:forEach items="${param}" var="pin">
param name: <c:out value="${pin.key}" />
value: <c:out value="${pin.value}" />
btw, <c:out value="${param}" /> <br>
<h2> kkk </h2>
</c:forEach>
</body>
</html>خروجی که به دست میارم اینه:
this is it!
This is from inside the loop.
This is from inside the loop.
This is from inside the loop.
This is from inside the loop.
This is from inside the loop.
$header["host"]} ${10 mod 4}
param name: ${pin.key} value: ${pin.value} btw, ${param}
kkk
نمیتونم بفهمم آخه تگ forEach یکجا کار داده. یکجای دیگه نه. بعدم نمیدونم چرا مقدار متغییرهای محیطی برگشت داده نمیشه. یک دو جین سورس توی اینترنت دارن اینجوری کار میکنن.
اگه کسی میدونه قضیه چیه لطفا به من عاجز بینوا کمک کنه.
:گریه:
این سورس فایل jsp من هستش:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>A JSP Page With Parameter Looping</title>
</head>
<body>
this is it! <br>
<c:forEach begin="1" end="5" step="1">
This is from inside the loop.<br>
</c:forEach>
<c:out value='$header["host"]}' />
<c:out value="${10 mod 4}" />
<br>
<c:forEach items="${param}" var="pin">
param name: <c:out value="${pin.key}" />
value: <c:out value="${pin.value}" />
btw, <c:out value="${param}" /> <br>
<h2> kkk </h2>
</c:forEach>
</body>
</html>خروجی که به دست میارم اینه:
this is it!
This is from inside the loop.
This is from inside the loop.
This is from inside the loop.
This is from inside the loop.
This is from inside the loop.
$header["host"]} ${10 mod 4}
param name: ${pin.key} value: ${pin.value} btw, ${param}
kkk
نمیتونم بفهمم آخه تگ forEach یکجا کار داده. یکجای دیگه نه. بعدم نمیدونم چرا مقدار متغییرهای محیطی برگشت داده نمیشه. یک دو جین سورس توی اینترنت دارن اینجوری کار میکنن.
اگه کسی میدونه قضیه چیه لطفا به من عاجز بینوا کمک کنه.
:گریه: