---
title: "jstl的forEach使用和jstl变量实现自增"
author: "qsrock"
date: "2008-01-15T10:58:11Z"
tags: ["C", "C#", "C++", "Java", "SUN"]
slug: "jstl-foreach-jstl"
draft: false
lastmod: "2008-01-15T10:58:11Z"
id: 155951
url: "https://qsrock.iteye.com/blog/155951"
---

\[code="java"] (&lt;%=i %&gt;) ${reallyChooseSubject.name} A.${reallyChooseSubject.answer\_A} B.${reallyChooseSubject.answer\_B} C.${reallyChooseSubject.answer\_C} D.${reallyChooseSubject.answer\_D} &lt;%i++; %&gt; \[/code] 在循环中变量自增: \[code="java"]&lt;%@ page contentType="text/html;charset=gbk" %&gt; &lt;%@taglib uri="http://java.sun.com/jstl/core\_rt" prefix="c" %&gt; x index:${index} x:${x }

\[/code]