• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use <%=temp%> i retrieving data

 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Marc for the reply. could you please help me how do i solve this.

Thanks
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rakesh Keerthi,
Your post was moved to a new topic.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic