Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: saving list of data from JSP into java object

  1. #1
    Member
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default saving list of data from JSP into java object

    Hi all, can anyone please give me a example where i can save the form data in a jsp into an java object on the click of save button


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,225
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: saving list of data from JSP into java object

    Its a complete guess without any sort of context...save where? From an HTML form? Have you written a pojo to store all the form data?

  3. #3
    Member
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: saving list of data from JSP into java object

    I have JSP page where on click of the submit button the data has to be saved in a java object.The JSP page has some of the list variables as well as string variables

    Thanks

  4. #4
    Member
    Join Date
    Nov 2010
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: saving list of data from JSP into java object

    I have the same problem.

    I have a servlet which shows a table full of data and text fields.
    I save that current data into a java bean and load another servlet.

    I then try and access the data saved into the java bean but it wont access this because when the first servlet closes down the data is lost.

    i want to do this so the user can change the data in the text box and i can do i comparison between what was and what is on the data.

    Thanks for you help.
    Kurt

    I have JSP page where on click of the submit button the data has to be saved in a java object.The JSP page has some of the list variables as well as string variables
    the JSP form, does that just create the form? if yeah, you might as well change it to html and name the elements so you can use the getParameter method from the button click.

    Need more information...

    Kurt

  5. #5
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,225
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: saving list of data from JSP into java object

    The answer depends upon how long you wish the data to persist. For session data, just store this as a pojo as a session variable. For longer term, use an EntityBean, persist the data in a database, or serialize the pojo (this all depends upon how you want to save the data and your application data model). To save the data after a button press, you must send the data back to the server either through AJAX or by submitting the form via the webpage.

Similar Threads

  1. saving data in persian language in mysql db
    By java_cs in forum JDBC & Databases
    Replies: 2
    Last Post: January 19th, 2011, 11:26 AM
  2. Please list some Java obfuscators !!
    By Ritesht93 in forum Java Theory & Questions
    Replies: 1
    Last Post: December 29th, 2010, 05:47 PM
  3. need help with saving data
    By bardd in forum Java Theory & Questions
    Replies: 5
    Last Post: September 19th, 2010, 02:33 PM
  4. data and object streams
    By bbr201 in forum Java Theory & Questions
    Replies: 4
    Last Post: July 16th, 2010, 06:18 PM
  5. store a list/string for each object
    By tommy in forum Object Oriented Programming
    Replies: 5
    Last Post: May 28th, 2010, 09:24 AM