Dears,
I am having issue in running javax.script when deployed on Google
Appengine. Please note local DEV environment is working just fine. I am
pasting a hello world servlet below which has issue.
Thanks in advance.
Faisal Iqbal
********************************************************************************************************************************************************************************
import java.io.IOException;
import javax.servlet.http.*;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.ScriptEngine;
@SuppressWarnings("serial")
public class MyScriptServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
// create a script engine manager
ScriptEngineManager factory = new ScriptEngineManager();
// create a JavaScript engine
ScriptEngine engine = factory.getEngineByName("JavaScript");
// evaluate JavaScript code from String
try {
engine.put("rs", resp);
engine.eval("rs.getWriter().println('This is from script')");
} catch (ScriptException e) {
resp.getWriter().println("Exception Catched");
e.printStackTrace();
}
resp.getWriter().println("Hello, Faisal Iqbal");
}
}
************************************************************************************************************************************************************
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.