hi all, I have a frame in which i want server date time. every time i click link the time gets adds to text area. Can u please help me.
Hi, I got the value of server on jsp, but i cant update it. once i get the value it doesnt change with time.
write a javascript clock after getting time from server. Search on G the code for javascript clock Regards Alex
Maybe you can use AJAX. For example : You have index.jsp There is a button and a read-only text field in index.jsp. When s/he clicks the button, the text field will be filled with current server time. Here're the steps Create a file for example named time.jsp. When a user visits time.jsp directly in his / her browser, s/he will get the current server time. The time is written in JSP code (i don't know the JSP syntax to write the current time). Now add AJAX code in index.jsp. When the button is clicked, put the AJAX request here. a request to time.jsp is made. The AJAX request result will be inserted in the read only text field, or in any place (in index.php).
Ok, but i don't know how to get current time in Java (JSP). Can you give me some lines about how to get current time in Java ?
I'm not sure if this is even close to what you want but is it something like this: <html> <head> <script type="text/javascript"> var today = new Date(); </script> </head> <body> <form> <textarea name="textarea1"> </textarea> <input type="button" value="ADD DATE" onClick="this.form.textarea1.value+=[new Date()]"> </form> </body> </html> Code (markup):