This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes struggling with repeated values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struggling with repeated values" Watch "struggling with repeated values" New topic
Author

struggling with repeated values

Sandeep Jidagi
Greenhorn

Joined: Apr 23, 2012
Posts: 9
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


Thanks and Regards,
Sandeep
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

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.



"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Sandeep Jidagi
Greenhorn

Joined: Apr 23, 2012
Posts: 9
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

Joined: Apr 23, 2012
Posts: 9
Problem Resolved
updated code


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: struggling with repeated values
 
Similar Threads
struts-html.tld not found help me please
Problem with html:options
LabelValueBean html:select
Populating List thru logic:iterate , The modified List is not reaching action
how to get back bean value in javascript