• 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

I didn't understood the term javascript Engine, What does it mean.

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I searched on Wikipedia , but i didn't understood the explanation.

Many article says that Javascript engine is used for "Javascript Web server",

But how come web server ?

I have worked on Tomcat server and having knowledge of J2EE framwork,
here a browser send request using a url, now this request hits the web container(Tomcat),
now web container creates req. and res. object and passes it to servlets deployed in webcontainer.



Now from my above knowledge of Web container can you please explain how come javascript be
a web container, and how does it helps us in client-side javascript


Does javascript engine has anything to do with auto-refresh of web-pages

Waiting for the reply
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Javascript is a programming language, like any other language. Like any language, it is capable of doing anything that its compiler/interpreter/runtime allows.
Historically, it's associated with client side web browser interaction, but that is only because the first javascript engines were browser centric.
New engines like Node.js give it capabilities like threads and sockets, which means it can run like any server side language.

In fact, it's possible to serve HTTP requests using Javascript even from a regular JavaEE environment, using JavaSE6 scripting API and with a little help from regular servlets. Trythis servlet which gets all HTTP HTML responses from javascript code by loading and executing an appropriate JS file based on path in HTTP request:



//sayHello.js - invoke with http://localhost:8080/JavaScriptServlet/sayHello


//table.js - invoke with http://localhost:8080/JavaScriptServlet/table?header=Title


In this example, javascript code is piggybacking on JRE for sockets and other system resources. In pure javascript servers like Node.js, the Node runtime provides sockets and other system resources.



 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic