简体   繁体   中英

how to write jsp struts2 for loop

I want to write a for loop in jsp like this

for(int i = 0; i< max;i++){
  print("something");
}

where "max" and "something" are in variables in action class. what are the tags to write this. can you provide me sample code?

You can use struts2 iterator tag

Documentation and Examples on Apache Struts2 Website

Also, I would suggest reading a Documentation/Get Started or Tutorial before getting started on a struts2-web project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM