I'm using the following code in a JSP
file which I serve from an AppEngine
serlvet.
<script type="text/javascript" >
var role = <%= request.getAttribute("role") %>;
</script>
The variable is set from a Servlet
using:
req.setAttribute("role", role );
req.getRequestDispatcher("index.jsp").forward(req, resp);
The code runs fine on AppEngine production but in the local development server I get the following straight away:
Problem accessing /. Reason:
INTERNAL_SERVER_ERROR
Caused by:
java.lang.StackOverflowError
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:438)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:438)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:438)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:438)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:438)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:438)
at org.mortbay.jetty.servlet.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:438)
this goes on like forever. While debugging, I can also see that the Servlet code is called endless times.
I found a few references to a similar problem with AppEngine production but found no workable fix for AppEngine development server.
Any idea ??