Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

struggling with repeated values

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I've problem with my program which includes Struts framework.
If I run my application it displays the first values. If I insert another values in to the arraylist, current values is overwrtten with previous values and also copied to the next place and son in the 3rd time when inserting..

Here's My Code.

AdminAction.java

StudentBean.java

display.jsp

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch. I added Code Tags to your post to make the code easier to read. Please use them in the future.

Your code is confusing. The StudentBean is both a single student and a collection of students? That's a Bad Idea.

 
Sandeep Jidagi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI.. Joe Ess StudentBean is bean class. which gets data from the StudentForm class.
I'm using this StudentBean Class to display data using <logic:iterate> tags.

Even I used static arraylist.

My Output Example:
After submitting the form for Sandeep
Sandeep: Your Request Receieved

After submitting the form for Anand.
Anand: Your Request Receieved

I need to get the output in display.jsp like:[Exapected]

Sandeep
Anand

but actual output i'm getting
Anand
Anand.

Please Help Me.

 
Sandeep Jidagi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem Resolved
updated code


 
All of the following truths are shameless lies. But what about this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic