views:

77

answers:

3

Hi,

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.

+1  A: 

Have you taken a look at this tutorial on running Rhino on GAE?

It's a link from the official "Will it play in App Engine?" thread.

matt b
The first link is definitely helpful, but doesn't cover my situation: I want to import the files into Eclipse…
FB55
+1  A: 

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

Jason Hall
I already found AppengineJS, but don't see a reason to use it in this project. If I would want to create a larger project from the ground, I would do it in Java, just because it's faster.
FB55
@FB55 In that case, you should clarify your question. In your question, you say you want to run Javascript code on App Engine - which is exactly what appenginejs.org is for.
Nick Johnson
FB55
+2  A: 

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.

echo-flow