The method getParmaeter(String) is undefined for the type HttpServletRequest

<%@ page pageEncoding="gb2312"%>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<% request.setCharacterEncoding("gb2312");%>

<%@ page import="java.sql.*" errorPage="" %>
<%@ page import="javabean.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.text.*" %>


/jsp:useBean



注册检查


<%
request.setCharacterEncoding("gb2312");
String rand = (String)session.getAttribute("rand");
String input=request.getParameter("rand");

if (rand.equals(input))
{

try{
request.setCharacterEncoding("gb2312");

String str_name=request.getParameter("username");
String sqlname="select * from tb_user where username='"+str_name+"'"; //表名user
ResultSet rsname=sqlbean.executeQuery(sqlname);
if(rsname.next()) //判断是否有雷同的数据存在,即判断是否有已注册的用户名。
{ out.println("alert(&#39;该用户名已经存在,请使用其他用户名!&#39;);window.location=&#39;index.jsp&#39;;"); }
else{
request.setCharacterEncoding("gb2312");
String str_datatime=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getDate());
String str_password=request.getParameter("password");
String str_password2=request.getParameter("password2");
String str_sex=request.getParameter("sex");
String str_email=request.getParameter("email");
String str_question=request.getParameter("question");
String str_answer=request.getParameter("answer");
String str_qq=request.getParmaeter("qq");
String str_words=request.getParameter("words");
String sqlinsert="insert into tb_user (username,password,sex,email,question,answer,qq,str_datatime,words) values('"+str_name+"','"+str_password+"','"+str_sex+"','"+str_email+"','"+str_question+"','"+str_answer+"','"+str_qq+"',"+str_datatime+"','"+str_words+"')";
out.println("alert(&#39;恭喜,注册成功!&#39;);window.location=&#39;index.jsp&#39;;");}
sqlbean.close(); }
catch(Exception ex)
{ out.println("alert(&#39;注册失败!请重新注册。&#39;);window.location=&#39;index.jsp&#39;;"); }
}
else
{ out.println("alert(&#39;验证码输入错误,请重新输入!&#39;);window.location=&#39;index.jsp&#39;;"); }
%>

查看全部
w098216470
w098216470
2011/03/05 17:58
  • it技术
  • 互联网问答
  • IT行业问题
  • 编程语言问答
  • 计算机技术
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复