• 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
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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.
 
Master Rancher
Posts: 3675
40
  • 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.
 
Marshal
Posts: 4469
284
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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!