I’m aware of server-side javascript for a long time now, but I don’t have a clue about how it works. Could someone point me in the right direction?
I’m interested in how to use server-side javascript + Java Servlet technology
EDIT
Great! I have seen those technologies before, but for some reason I didn’t associate them with “server-side” javascript ( doh! )
Complementary question: if I want to use a javascript library to create content ( ExtJs for instance ), am I able to have a “document” to modify in the server-side as I do in the client?
( I guess I’ll find out in my first attempts )
Running javascript server side requires a javascript engine that can be embedded. Most of these “embeddable” engines provide an API that lets you interface between the executing javascript code and your own objects/methods. For example, you might have javascript code hooked up to allow the execution of functions written in Java or C#, or you might augment the symbol table of a script to include access to non-javascript objects in your system.
I would take a look at some of these engines, I’m guessing Rhino may be the best fit for you as its written in Java. Their tutorials outline embedding Rhino in a Java environment.
Edit in response to your second question.
I’m not sure exactly what you mean by content generated by a javascript library. You mention ExtJS however, which would imply HTML content I believe?. It’s important to understand the difference between the DOM (which Javascript can read and modify but is not “part” of Javascript per se) and Javascript the language. If you need the idea of a DOM server side that’s a different story, if you need the Javascript language then the above options should help you out.