Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes Passing workStation time to a servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing workStation time to a servlet?" Watch "Passing workStation time to a servlet?" New topic
Author

Passing workStation time to a servlet?

Tom Barns
Ranch Hand

Joined: Oct 27, 2000
Posts: 138
I'm trying to get the work station time using javascript.
then i want to pass it(time) with the url to a servlet,because i need to count the time of loading and servicing time for the servlet.
Here is a sample code and i know that doesn't work,i need to know how to access that script,or in other i need to call that script and assign the value from it to a variable,then i append that variable to the url.
thanks for your help.
//code===============
<html>
<form>
<script language = "javascript1.2">
function getTime()
{
return new Date().getTime();
}
</script>
<frameset rows="*,*">
<frame src="http://localhost:8080/examples/servlet/myServlet?startime=getTime()" >
</frameset>
</form>
</html>
//=========================


Thanks for your help.
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
Well, the question you asked is really a JavaS****t question, but the following will work:

But why bother? Can't you use the server's time System.currentTimeMillis()?
------------------
Phil Hanna
Author of :
JSP: The Complete Reference
Instant Java Servlets
[This message has been edited by Phil Hanna (edited April 19, 2001).]


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing workStation time to a servlet?
 
Similar Threads
Target login page after timeout
Passing javascript variable to SRC
Form and JavaScript in Frameset
Question on Body onload Javascript
newbie multiple frames problem