Get all updates of Java4s
Follow Us: Email Newsletter

Struts 2 Iterator Tag Example

Struts » On Oct 29, 2011 { 1 Comment } By Sivateja

Let us see how to use iterator tag in struts 2, actually iterator is the best tag to use rather writing while loop to print collection of objects in jsp’s.  if we use while loop we may need to write 4 - 5 lines but we can get the same result with iterator with 1 line hah.

Example

required files….

  • index.jsp
  • success.jsp
  • web.xml
  • struts.xml
  • LogingEx.java

Directory Structure

index.jsp

success.jsp

LogingEx.java

web.xml

struts.xml

Output

You Might Also Like

  ♦ About Author ♦

Java4s_Author
sivateja@java4s.com
Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

One Response to “Struts 2 Iterator Tag Example”
  1. man says:

    Hi,

    Is it possible to use only struts 2 taglibs for my JSP without using action class and filter dispatcher.

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
Upcoming
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2016 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.