The method getparameter(String) is undefined for the type HttpServletRequest
<@ page contentType ="test/html;charset=gb2312" language="java" import='java.*.*'%>
<%!
public String codeToString(String str){
String tempString = str;
try{
byte tempB[] = tempString.getBytes("ISO-8859-1");
tempString = new String(tempB);
return tempString;
}catch (Exception e){
return tempString;
}
}
%>
<%
if(request.getparameter("username")==null){
out.println("你还没有输入姓名");
out.println("You haven't entered your name!");
}
else{
out.println("你的姓名为(Your name is):"+codeToString(request.getParameter("username")));
}
%>
查了很久,才发现我这个是大小写写错了,是getParameter(),P要大写,下面是查到的没写错的其他解决方法