aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes I didn't understood the term javascript Engine, What does it mean. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "I didn Watch "I didn New topic
Author

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

Rahul Shivsharan
Ranch Hand

Joined: Jun 17, 2009
Posts: 83
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
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 513
    
    6
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.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I didn't understood the term javascript Engine, What does it mean.