Hi I am facing a error named \"The method print(boolean) in the type JspWriter is not applicable for the arguments (void) \" with my JSP code in GAE.
In line :
<%= %>
expects an expression, whose value is printed to the JSP's writer. The following
<%= foo %>
is thus equivalent to
out.print(foo);
request.getSession(true).setAttribute("state","firstNumber")
is an expression whose type is void. And you can't print a void.
What you want is simply
<% request.getSession(true).setAttribute("state","firstNumber") %>
But of course, as it has been rehashed countless times, scriptlets should not be used in a JSP. JSPs are view components which should only generate HTML using the JSP EL, the JSTL and other custom tags. Not to mention that setting session attributes is, in general, a bad idea, and is even more a bad idea in a view component, which shouldn't have any side effect other than printing to the JSP writer.