• 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

Updating a table in HTML using JSP.  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on a project in HTML and in one of the JSP page it retrieves a table data from the database but i'm really confused in "How will i change the table data in JSP if an event occurs"...
 
Ranch Hand
Posts: 54
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You question is not clear , please tell us the actual scenario... Do you wanna change the data of the table or you wanna refresh table data in jsp?
 
Vasiq Molvizadah
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've a webpage which retrieves the "Book Lists" from the database and it puts the data in the table. But when i click on the next button/next page, how the Table Data should change.

Look at the code below.
 
Author and ninkuma
Marshal
Posts: 66820
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You either need to refresh the entire page with the new data, or use Ajax to replace only the table in the page.

In either case, putting Java code into a JSP, especially database access code, is a really poor practice. you should refactor your JSP to modern standards.
 
Deepakkumar Devarajan
Ranch Hand
Posts: 54
Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refresh you webpage every five seconds using javascript. The below code will refersh the page every 10 seconds.



You should have done the DB connection part in DAO, Before loading this JSP page, go to servlet Create and instance forl DAO class and perform all necessary operations (retain all values in bean)and forward your response to JSP. This will be good practice for a beginner, then slowly move to advanced frameworks
 
Greenhorn
Posts: 2
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


WHEN THIS PAGE IS REFRESH, THE TABLE DOESN'T UPDATE, THE BROWSER SHOW THE SAME CONTENT ALWAYS, I DON'T KNOW, HOW TO REPAINT THIS PAGE WHEN THE DATABASE INFORMATION CHANGE

THANKS!!!

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!