• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Updating a table in HTML using JSP.

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67693
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!

 
reply
    Bookmark Topic Watch Topic
  • New Topic