The start is clearly to look into rhino.
I think you will find this 3 links very useful
- JavaScript EE, Part 1: Run JavaScript files on the server side
- JavaScript EE, Part 2: Call remote JavaScript functions with Ajax
- JavaScript EE, Part 3: Use Java scripting API with JSP
You can also have a look to helma
Helma is a server-side Javascript environment and web application framework for fast and efficient scripting and serving of your websites and Internet applications.
Helma is written in Java and employs Javascript for its server-side scripting environment …