This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

jsp update error  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir!! Please help!!
I have a code in jsp in which I have update button with each row of sql table. But only the first row gets updated and the rest update buttons donot work. I don't know what's going wrong?
 
Ranch Hand
Posts: 614
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is because there are multiple textboxes with same name "ENO". It should have unique values for name attribute in your case.
When request.getParameter("ENO") is called, it returns the value of the first element in the FORM with name ENO, which is the 1st row in your FORM.

NOTE: Never ever write Java code in a JSP. This is very bad practice.
 
Rancher
Posts: 3991
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't be doing database work in the JSP.
The values to display should be passed in, from your servlet.

That said, what does the HTML produced by this look like?
It's the HTML in the browser that is not working, so that's where you should be looking.
 
Sheriff
Posts: 4600
295
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, and welcome to the Ranch!

When posting code it is encouraged that you UseCodeTags (<- click) to make your code easy to read. I've added them for you this time, see how much better it looks!
 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!