Error loading jsp after submission of data in Dbs.
posted 1 year ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi,
Can anyone please suggest me how to reload a JSP page when user updates any value in the database from the screen?
Actually when user changes any value in the JSP it is being updated in the database but when the JSP reloads it is getting half.
Thank you.
Can anyone please suggest me how to reload a JSP page when user updates any value in the database from the screen?
Actually when user changes any value in the JSP it is being updated in the database but when the JSP reloads it is getting half.
Thank you.
posted 1 year ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Welcome to the Ranch, Palak!
The first thing to realize is that JSPs are not like time-sharing terminal displays. The only way to get a JSP to update is if the client sends a new request to the server so that the server can send back a new JSP (or whatever).
You can get around that by putting an auto-refresh option in the HTML that your JSP generates. In ancient times, it was common to use a special META tag to do that. These days we often use AJAX, since that allows updating only part of a page instead of replacing the whole page on the client side.
HTTP servers likewise don't run "programs". Instead they provide services that are run when a request comes in and those services must then provide the response back to the client. So there's nothing to sit around and get updated from the database. Instead the request processor has to read from the database on each request.
In JEE, reqest processors are servlets. For JSPs, the JSP compiler generates a servlet by turning the JSP source into Java code, then compiling the Java code into a class. That's all automatically done for you,
The first thing to realize is that JSPs are not like time-sharing terminal displays. The only way to get a JSP to update is if the client sends a new request to the server so that the server can send back a new JSP (or whatever).
You can get around that by putting an auto-refresh option in the HTML that your JSP generates. In ancient times, it was common to use a special META tag to do that. These days we often use AJAX, since that allows updating only part of a page instead of replacing the whole page on the client side.
HTTP servers likewise don't run "programs". Instead they provide services that are run when a request comes in and those services must then provide the response back to the client. So there's nothing to sit around and get updated from the database. Instead the request processor has to read from the database on each request.
In JEE, reqest processors are servlets. For JSPs, the JSP compiler generates a servlet by turning the JSP source into Java code, then compiling the Java code into a class. That's all automatically done for you,
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
| What's that smell? I think this tiny ad may have stepped in something. The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











