Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struggling with repeated values

 
Sandeep Jidagi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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

 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Problem Resolved
updated code


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic