JSP and HTML - Refreshing that doesn't up data the webpage
In my web client I have inside an if statement开发者_JS百科 a command like this
myList = myBean.getNewList();
that references a global List and is displayed in table form in the web page.
How is it that my web page doesn't update the table on screen till I refresh the page again? It seems to refresh by its self straight away after a button is pressed
Where is that code? In the *.jsp file, or in some backing java action?
Most likely, that code is never called until there is a request made to the server, via a button click which would probably do one of the following (depending on your application):
- Submitting a form or making some request to the server and building some response object to be rendered by your browser
- Make some Ajax call to change the innerHtml of one of your DOM elements
- use jQuery (or some other javascript) to change the innerHTML on the fly with some hard-coded data
精彩评论