Hey all - for background, I'm building a web application using Spring MVC.
On my web application, I have a dynamic form, where user can add Rows by clicking a button. Each row is represented in Java by an object, with a handful of properties. Nothing super complicated. As a user adds new Rows, each now Object is added to an Autopopulating List, and then stored in a database when the user hits Save.
The issue is, when I'm pulling the properties out of the Autopopulating List to store them, the list seems to have appended a comma. So, for example, if the user entered "Database Server" as the 'Role' property, when I print reqList2.get(i).getRole(), it comes out as "Database Server,". I find this odd, because the Row property isn't directly a part of anything that I think should be in any kind of csv format. It's not in a list with other rows. It's by itself, in an object, which is in a list of other objects. So I'm confused about where this comma is coming from, and how I can get rid of it.
This is obviously an abbreviated version of my code, but I've included most of what I think is relevant below. If there's any other component you think would be useful to see, let me know!
"AppendRequirements.jsp" -- this is fetched by Ajax and added into the webpage when the user clicks "Add New". The "Role" row, specifically is the one giving me this issue. It's also the only "Textbox" entry on this form, which may or may not be relevant to the problem.
Code:
recordModel.java
Requirements.java
daoImpl.java
On my web application, I have a dynamic form, where user can add Rows by clicking a button. Each row is represented in Java by an object, with a handful of properties. Nothing super complicated. As a user adds new Rows, each now Object is added to an Autopopulating List, and then stored in a database when the user hits Save.
The issue is, when I'm pulling the properties out of the Autopopulating List to store them, the list seems to have appended a comma. So, for example, if the user entered "Database Server" as the 'Role' property, when I print reqList2.get(i).getRole(), it comes out as "Database Server,". I find this odd, because the Row property isn't directly a part of anything that I think should be in any kind of csv format. It's not in a list with other rows. It's by itself, in an object, which is in a list of other objects. So I'm confused about where this comma is coming from, and how I can get rid of it.
This is obviously an abbreviated version of my code, but I've included most of what I think is relevant below. If there's any other component you think would be useful to see, let me know!
"AppendRequirements.jsp" -- this is fetched by Ajax and added into the webpage when the user clicks "Add New". The "Role" row, specifically is the one giving me this issue. It's also the only "Textbox" entry on this form, which may or may not be relevant to the problem.
Code:
recordModel.java
Requirements.java
daoImpl.java