Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7087925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:44:02+00:00 2026-05-28T07:44:02+00:00

I have the following ArrayList in my Action Class : List<Student> students = ArrayList<Students>();

  • 0

I have the following ArrayList in my Action Class :

List<Student> students = ArrayList<Students>();

I have also created the associated setters & getters.

JSP snippet:

<s:form action="updateStudent">
 <s:iterator value="students ">
  <tr>
    <td><s:property value="name" /></td>
    <td><s:property value="address" /></td>
    <td><s:property value="age" /></td>
    <td><s:textfield name="mobile" /></td>  
  </tr>
 </s:iterator>
</s:form>

Displaying the information on JSP after fetching the information from the database works fine.

I need to edit the mobile & push back the same to database. But when I submit the form, the ArrayList “students” is nullified.

How can I push the information back to database. Not able to persist.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:44:03+00:00Added an answer on May 28, 2026 at 7:44 am

    Use array notation in the form:

    <s:form action="updateStudent">
      <s:iterator value="students" status="stat">
        <s:textfield name="students.mobile[%{#status.index}]" />
      </s:iterator>
    </s:form>
    

    You shouldn’t need to explicitly create a list in the action, but if you do, make sure the creation happens before the parameter interceptor tries to fill its values otherwise you’ll overwrite the list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following action class: package com.pendulum.web; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest;
Let us have the following code: public class TestGenerics { static <T> void mix(ArrayList<T>
I have the following class: class SampleClass { private ArrayList mMyList; SampleClass() { //
I have the following: public class Foo<T extends Grok> extends ArrayList<T> { } How
I have the following classes: public class CollectionCustomClass extends ArrayList<CustomClass> public abstract class CustomClass
I can't figure this out. I have the following code: import java.util.ArrayList; import java.util.List;
i have the following bean: public class MyBean { public ArrayList<ReportRow> getReportRows() { return
I'm following this MVC model: http://java.sun.com/developer/technicalArticles/javase/mvc/ In my model I have an ArrayList shapes
I have following classes. class A { public: void fun(); } class B: public
I have the following Programm package utests; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.