日期:2014-05-17  浏览次数:20675 次

JSP中 !The server encountered an internal error () that prevented it from fulfill
为什么我运行
<%@ 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 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 
谁能帮我解答 谢谢

------解决方案--------------------
name,sex,age,submit这些属性都有吗?他们当中应该有一个为null
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html