| Author |
how to send data from JSP based on a condition to Controller
|
Manu ravi
Greenhorn
Joined: Aug 15, 2012
Posts: 16
|
|
Hi,
When a user enters data in a table, I want to send unique data to controller.
I have used javascript to get the values of each row in table. I have compared each row with every other row to ensure that there are no duplicates. Using the data is being sent to controller. However this sends all the data to the controller.
My question is how do I send only the valid data that I find through javascript to the controller? I am using spring framework.
|
 |
Jack Numen
Greenhorn
Joined: Nov 09, 2011
Posts: 27
|
|
Seprate the Unique data you wanna send in other form.
Call the required submission function in Javascipt
Code might not be exaclty like this but the idea is submitting only required values based on some check parameter..Ita can be a checkbox or some condition which you can frame in your Javascript
|
 |
Manu ravi
Greenhorn
Joined: Aug 15, 2012
Posts: 16
|
|
My problem is that I got what you are saying but I doubt the architecture of the application would let me do that...
I have a table in jsp that goes like:
I am using javascript to get each row in the table. I am displaying existing rows in table and allowing user to add new rows. When I add new rows, onsubmit it calls javascript function:
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56201
|
|
|
What the JSP does is irrelevant. That happens on the server long before the JavaScript runs. It's what gets sent as the response to the browser that matters.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Manu ravi
Greenhorn
Joined: Aug 15, 2012
Posts: 16
|
|
|
so is there no way where i can stop the original data from getting passed to controller?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56201
|
|
|
Have you not read the replies?
|
 |
 |
|
|
subject: how to send data from JSP based on a condition to Controller
|
|
|