Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Problem with two "logic:iterate" tags

 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers ,

I am using two list one is of "name" and other is of "id" , Now i want this two list to be printed on JSP page simultaneously using "logic:iterate" . like this :

name1 id1
name2 id2
.
.

I.e i want to make something like this .. (for i=0, j=0; i<5; i++,j++) in JSP.

How should I do that,
Please Help !!
 
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's better to have a DVO that has the appropriate mutators for the variables and iterate over it.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It's better to have a DVO


Can you just explain me what is DVO ?? and if you are pointing me towards bean , then is it necessary to add bean object into list and then access it on JSP page thru iterator ??
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A DVO is Data Value Object now more commonly known as DTO, a Data Transfer Object. Yes, indeed it is a bean but just a bit special as it is used to transfer object values.

Now, say you have two properties in your bean username and password and as you say you have multiple values for the same. So, indeed you need to bind it in an iteratebale collection and ten use it on your jsp. Precisely maybe an ArrayList of your DVO objects.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

A DVO is Data Value Object now more commonly known as DTO, a Data Transfer Object.


Actually, the widely used name is either Value Object (VO) or Data Transfer Object (DTO). VO is considered as the old name for DTO.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the explanation , sir ..
But my real problem is , i don`t want to use bean , because i don`t want make one more java class , which gonna used only once (i.e when user first access it , after that there is no need of it ) . Now, thats mean there is no other way, so that I can access both list simultaneously on JSP page OR i need to use scriptlet <% %> tag (that is java code on JSP , and i also dont prefer that kind of mixing..)

So the bottom line is , i need to used DTO only , thats the ultimate solution , right ??
 
Did you just should on me? You should read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!