读书人

简单有关问题出错:Enumeration canno

发布时间: 2012-01-18 00:23:26 作者: rapoo

简单问题出错:Enumeration cannot be resolved to a type
练习 request.getParameterNames()的用法,
html页面有个form,调用jsp页面
jsp页面
<%@ page contentType= "text/html;charset=gbk "%>
<%@ page import= "javax.util.* "%>
<%
request.setCharacterEncoding( "GBK ") ;
Enumeration enu = request.getParameterNames() ;
%>
运行出错:
An error occurred at line: 5 in the jsp file: /demo08.jsp
Generated servlet error:
Enumeration cannot be resolved to a type

why?????????????????

[解决办法]
这是你写的!
<%@ page contentType= "text/html;charset=gbk "%>
<%@ page import= "javax.util.* "%>

这是我写的:
<%@ page language= "java " import= "java.util.* " pageEncoding= "GBK "%>
这行就没用了request.setCharacterEncoding( "GBK ") ;

改改试试
[解决办法]
<%@ page import= "javax.util.* "%>

改成

<%@ page import= "java.util.* "%>
[解决办法]
你查一下JDK的文档就知道了,没有javax.util包,只有java.util

http://java.sun.com/j2se/1.5.0/docs/api/

[解决办法]
你的jdk版本是不是太低了?

读书人网 >Java Web开发

热点推荐