• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing workStation time to a servlet?

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
//=========================
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic