• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 4727
Mac VI Editor Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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}"
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rakesh Keerthi,
Your post was moved to a new topic.
 
reply
    Bookmark Topic Watch Topic
  • New Topic