| Author |
how to use <%=temp%> i retrieving data
|
Rakesh Keerthi
Ranch Hand
Joined: Jul 16, 2012
Posts: 103
|
|
Hi I have the below code in my jsp
alternatively i used EL as shown below.
and in my servlet I've the below code
here i'm unable to retrieve the data from the textboxes, when i tried to print the results it is printing null.
please help me with how to retrieve the data.
This code is working if there is only 1 row.
Thanks
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4725
|
|
The parameter names aren't the same. You can see this by selecting "View Source" in your browser. You'll see that the parameters are NOT named things like "temp31" but rather are names like "1".
You also are susceptible to a SQL injection attack the way your putting the submitted answers directly into a database query.
|
A good workman is known by his tools.
|
 |
Rakesh Keerthi
Ranch Hand
Joined: Jul 16, 2012
Posts: 103
|
|
Thank you Marc for the reply. could you please help me how do i solve this.
Thanks
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4725
|
|
I'm not going to rewrite the entire thing for you. I want you to solve this problem.
Do you know what I meant when I said "View Source" in your browser? If so, have you tried it? What did you see?
Also, realize that you can put actual static text as part of a name to make it easier to retrieve the data:
name="upd${tempIndex}"
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
Rakesh Keerthi, Your post was moved to a new topic.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: how to use <%=temp%> i retrieving data
|
|
|