How is server-side javascript used / implemented?

I have known server-side javascript for a long time, but I do not know how this works. Can someone point me in the right direction?

I am wondering how to use javascript + Java Servlet server technology

EDIT

Fine! I have seen these technologies before, but for some reason I did not associate them with the "server" javascript (doh!)

Additional question: if I want to use the javascript library to create content (for example, ExtJs), can I have a โ€œdocumentโ€ for change on the server side, as well as on the client?

(I think I will find out in my first attempts)

+4
source share
7 answers

To run the javascript server, a javascript mechanism is required, which can be integrated. Most of these โ€œembeddedโ€ engines provide an API that allows you to interact between JavaScript executable code and your own objects / methods. For example, you may have javascript code connected to execute functions written in Java or C #, or you can expand the script symbol table to enable access to objects other than javascript on your system.

I would take a look at some of these engines, I suggest that Rhino may be best for you, since it is written in Java. Their tutorials describe how to implement Rhino in a Java environment.

Change in response to the second question.

I'm not sure what you mean by content generated by the javascript library. However, you point to ExtJS, what will the HTML content that I believe in mean? It is important to understand the difference between the DOM (which Javascript can read and modify, but is not a "part" of Javascript as such) and Javascript is a language. If you need an idea of โ€‹โ€‹the server side of the DOM, which is different from the story, if you need the Javascript language, then the above options will help you.

+6
source

Mozilla Rhino JavaScript engine is pretty easy to insert; it allows you to subclass Java classes and implement interfaces, as well as just perform some ingenious wraps around JavaScript objects. I am working on investing it in GeoServer at my moments for several months. You can take a look at the Java code that includes Rhino and some JavaScript examples in our SVN repository. Rhino also has a nice guide to get you started.

+3
source

ASP and ASP.NET support server-side JavaScript. For ASP, all you do is declare:

<%@LANGUAGE=JAVASCRIPT%> 

At the very top of the ASP file, and you code in JavaScript. ASP.NET is basically the same, except that you are accessing the .NET platform.

It is impossible to help on the Java servlet front, without experience.

+2
source

"Helma is a Javascript server and web application environment for quickly and efficiently writing scripts and serving your websites and Internet applications." - http://helma.org/

+1
source

I have extensive experience using server-side Javascript in a Windows environment. The Windows Scripting Host on all Windows systems provides Javascript as one of the default languages. You can create a COM object to interact with it from any language that supports COM. I think this MSDN page will get you started if you want to use this approach.

I have a feeling that you will be happier if you choose something that is not related to COM. I just wanted to make sure that you have all the options in front of you.

+1
source
+1
source

If all you have to do is bless your HTML as Excel, your HTML code may be better sent to the server and it will be served with the content header and the corresponding MIME type. On the server side of JS, a browser like the DOM is usually not implemented, so Ext will not work on the server side.

Alternatively, you can create your own HTML server and skip back and forth. For example, a Java POI Library can generate real Excel binaries with multiple worksheets and cell functions.

If you really want to use the server-side JS server as an application server, consider Myna . I mentioned some of its advantages in this question .

+1
source

All Articles