Build a JS server inside of Java for Google AppEng

2019-07-24 04:26发布

I just needed to create a little interface for a project. So I decided to take given code and to run it on Google AppEngine. My problem is, that I'm experienced in JavaScript and got some basic knowledge of Java, but I got no clue how a Java webapp has to be structured. I started Eclipse and installed the AppEngine-addon, downloaded Rhino and env.js (which is necessary for the bunch of code I need to run) but then found me in the situation of sitting on this files not knowing where to put them.

It would be great if someone could tell me in which directory to put which files for Rhino (I assume it's "/war/WEB-INF/lib/"), how to add the env.js-file and how to access all these files inside the .java-file which is the index of the app.

3条回答
别忘想泡老子
2楼-- · 2019-07-24 05:04

http://www.appenginejs.org/ may be of interest as well.

查看更多
神经病院院长
3楼-- · 2019-07-24 05:10
冷血范
4楼-- · 2019-07-24 05:15

I don't know about app engine in particular, but I have had good success using Rhino jsc to compile script files which extend the Servlet API. The end result is a nice WAR file which you can deploy in any servlet container, and perhaps App Engine as well. See here for my relevant blog post about this technique, and here for a sample Eclipse project.

查看更多
登录 后发表回答