Hello friends,
I had a requirement on some course I am doing to:
1. Create a
Servlet subclassing "strictly" generic Servlet (as opposed to HttpServlet).
2. Pass a value from the servlet to a newer HTML page.
3. Display the message from the servlet on the HTML page. If there is no message, display null (nothing).
1. At the servlet side, I am passing info through URL like this:
2. At the Javascript side, I have a transparent, disabled textbox to display the info passed (or nothing if no message passed):
3. Finally, using a JavaScript function, on window.onload of the HTML page, I am setting the value of the above textbox, with the input from the URL parameters as follows:
There could be other simpler ways to do the same. I would like to know about them, if any!
I hope the above code really helps someone out there, I spent A LOT and A LOT of time to figure this out, there was not any helpful internet resource to figure out the above!
Thanks.