为什么我运行
<%@ page language="java" contentType="text/html" pageEncoding="gb2312"%>
<html>
<head>
<title>request中的getparameter()方法</title>
</head>
<body>
<%--在这里设定request得到参数的字符编码,否则中文会出现乱码 --%>
<%request.setCharacterEncoding("gb2312");%>
得到用户输入的信息:<p>
<font color=red>姓名:<%=request.getParameter("name").toString()%><p>
性别:<%=request.getParameter("sex").toString()%><p>
年龄:<%=request.getParameter("age").toString()%><p>
</font>
获取按钮标记名:
<font color=blue>
<%=request.getParameter("submit").toString()%>
</font>
</body>
</html>
时候会显示如下错误
type Exception reportmessagedescriptionThe server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: java.lang.NullPointerException
root cause
谁能帮我解答 谢谢
<%@ page language="java" contentType="text/html" pageEncoding="gb2312"%>
<html>
<head>
<title>request中的getparameter()方法</title>
</head>
<body>
<%--在这里设定request得到参数的字符编码,否则中文会出现乱码 --%>
<%request.setCharacterEncoding("gb2312");%>
得到用户输入的信息:<p>
<font color=red>姓名:<%=request.getParameter("name").toString()%><p>
性别:<%=request.getParameter("sex").toString()%><p>
年龄:<%=request.getParameter("age").toString()%><p>
</font>
获取按钮标记名:
<font color=blue>
<%=request.getParameter("submit").toString()%>
</font>
</body>
</html>
时候会显示如下错误
type Exception reportmessagedescriptionThe server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: java.lang.NullPointerException
root cause
谁能帮我解答 谢谢
<FORM action="show.jsp" method=post name=form>
姓名:<INPUT type="text" name="name"> <p>
性别:<INPUT type="text" name="sex"> <p>
年龄:<INPUT type="text" name="age"> <p>
<INPUT TYPE="submit" value="enter" name="submit">
</FORM>
郁闷