This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

How to iterate using struts 2 ?

 
pioneer
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am new to struts 2. I have a method which returns arraylist, where as the array list containd collection of VO's.
How to get iterate it in jsp using struts 2 ?
example:
In this example, DataBaseDetails is my VO,which contains variuos fields like portno,database name,etc....



All the database names like mysql,oracle,derby will be populated in the combo box. I need to populate the values like portno,username on clicking the value in the combo box.
[ March 17, 2008: Message edited by: angelin precilla ]
 
gardener
Posts: 9612
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

All the database names like mysql,oracle,derby will be populated in the combo box. I need to populate the values like portno,username on clicking the value in the combo box.



So you aren't really talking about iteration as your topic title says. You want to know how you can select a connection in a list and display the connection's properties in a couple of text boxes, right?
Struts 2 has some AJAX functionality that could be used to fetch the values for the text boxes once a select box value is selected.
Another way to do this is to populate several Javascript arrays with the values for port number, user name, etc. and put an onclick action on the select box which populates your text boxes when a value is selected.
 
angelin precilla
pioneer
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
CAn you send me the sample example relevant to my query.
 
Joe Ess
gardener
Posts: 9612
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was my diagnosis of your problem correct?
Do you want to use AJAX or JavaScript to solve your problem?
 
angelin precilla
pioneer
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I have used JSON to populate the textboxes.
But I am getting script error as 'Expected identifier,String or Number'
My code is

I am getting the alert statement correctly.
I am getting script error after the alert statement.

[ March 17, 2008: Message edited by: angelin precilla ]
[ March 17, 2008: Message edited by: angelin precilla ]
 
Joe Ess
gardener
Posts: 9612
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You really need to read our FAQ, How To Ask Questions on JavaRanch
You are leaving out vital details about your problem and showing us source code that has nothing to do with your question. The better you frame your question, the more we will be able to help you, and the FAQ will help you do that.
 
Get me the mayor's office! I need to tell him about 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!