Here is the test.jsp
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%
String str = request.getParameter("str");
if (str.equals("play")) {
}
%>
Errors:
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.NullPointerException
root cause java.lang.NullPointerExceptionnote The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.1 logs.
The above code have errors if run, what the problems of above codes?
Change
if (str.equals("play"))toif (str!=null && str.equals("play"))Your request parameter is null it seems.