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 id="sqlbean" class="javabean.mysqlbean" scope="page"></jsp:useBean><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>注册检查</title></head><body><%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("<script language='JavaScript'>alert('该用户名已经存在,请使用其他用户名!');window.location='index.jsp';</script>"); } 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("<script language='JavaScript'>alert('恭喜,注册成功!');window.location='index.jsp';</script>");} sqlbean.close(); }catch(Exception ex){ out.println("<script language='JavaScript'>alert('注册失败!请重新注册。');window.location='index.jsp';</script>"); } }else{ out.println("<script language='JavaScript'>alert('验证码输入错误,请重新输入!');window.location='index.jsp';</script>"); }%></body></html><%@ page pageEncoding="gb2312"%><%@ page contentType="text/html; charset=gb2312" language="java" %><% request.setCharacterEncoding("GB2312");%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>用户注册</title> <style>body { background: #Ffffff; font-size:9pt; } A:link {text-decoration: none; color: #0066ff; font-size:9pt } A:visited { text-decoration: none; color: #1e90ff; font-size:9pt }A:hover { text-decoration: underline; COLOR: #006699; font-size:9pt }table{border-collapse: collapse}TD { FONT-SIZE: 9pt}.bigfont{font-size:11pt; }.input { border:1px solid #C0C0C0; background-color: #F7F7F7}.sb{background-color: #F7F7F7;border:1px solid #C0C0C0;solid:#000000}.textarea{border:1px solid #C0C0C0; background-color: #F7F7F7}.text{border: 1 solid #C0C0C0}</style> </head><body topmargin="0" leftmargin="0"><center><TABLE WIDTH=425 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="450"><TR><TD height="440" valign="top"><img border="0" src="/teath/images/userRegister.jpg" width="425" height="75"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="table1" height="331"><tr><td width="23" bgcolor="#E9E9E9"> </td><td valign="top"><table border="0" width="99%" cellspacing="0" cellpadding="0" id="table2" height="350"><tr><td width="11"> </td><td valign="top"><form action="check_register.jsp" name="form" method="post" onSubmit="return check()"><table border="0" width="350"><tr><td width="92" align="center"><font color="#FF0000">*</font>用&nbsp;户&nbsp;名:</td><td width="248" align="left"><input type="text" name="username" size="12"> 用户名大于4小于20个字符</td></tr><tr><td width="92" align="center"><font color="#FF0000">*</font>密&nbsp;&nbsp;&nbsp;&nbsp;码:</td><td width="248" align="left"><input type="password" name="password" size="12"> <font color="#FF0000">&nbsp; </font> 密码大于6小于20个字符</td></tr><tr><td width="92" align="center"><font color="#FF0000">*</font>重复密码:</td><td width="248" align="left"><input type="password" name="password2" size="12"> <font color="#FF0000">&nbsp;</font>必须与上面一致</td></tr><tr><td width="92" align="center"><font color="#FF0000">*</font>电子邮箱:</td><td width="248" align="left"><input type="text" name="email" size="12">E-MAIL必须符合规则</td></tr><td width="92" align="center"><font color="#FF0000">*</font>性&nbsp;&nbsp;&nbsp;&nbsp;别:</td><td width="248" align="left">男<input type="radio" name="sex" value="male">&nbsp;&nbsp;&nbsp;&nbsp;女<input type="radio" name="sex" value="female"> <font color="#FF0000">&nbsp;</font> 性别不能为空</td><tr> <td width="92" align="center"><font color="#FF0000">*</font>QQ号码:</td><td width="248" align="left"><input type="text" name="qq" size="12"> <font color="#FF0000">&nbsp; </font> qq不能为空</td></tr><tr><td width="92" align="center"><font color="#FF0000">*</font>问&nbsp;&nbsp;&nbsp; 题:</td><td width="248" align="left"><input type="text" name="question" size="34"></td></tr><tr><td width="92" align="center"><font color="#FF0000">*</font>答&nbsp;&nbsp;&nbsp; 案:</td><td width="248" align="left"><input type="text" name="answer" size="34"></td></tr><tr> <td width="92" align="center" valign="top">个人介绍:</td> <td width="248" align="left"><textarea name="words" cols="34" rows="5" ></textarea></td></tr><tr> <td align="right"><a href="#" onClick="javascript:var dt=new Date();document.getElementById('code').src='image.jsp?dt='+dt;">看不清楚换一张</a></td> <td><img id="code" border=0 src="image.jsp"></td> </tr><tr> <td width="92" align="center">验证码:</td><td width="248" align="left"><input type="rang" name="rand" size="12"></td></tr><tr><td colspan="2" align="left" height="117" valign="top"><br><center><input type="submit" name="submit" value="注册" class="sb"> &nbsp;&nbsp;<input name="reset" type="reset" class="sb" id="reset" value="清空"></center></td></tr></table></form></td><td width="11"> </td></tr></table></td><td width="24" bgcolor="#E9E9E9"> </td></tr></table></TD></TR></TABLE></BODY></HTML><script language="javascript"> function check() {username=trim(document.form.username.value);password=trim(document.form.password.value);password2=trim(document.form.password2.value);email=trim(document.form.email.value);question=trim(document.form.question.value); answer=trim(document.form.answer.value); qq=trim(document.form.qq.value); rand=trim(document.form.rang.value);if(username.length<4||username.length>20){alert("用户名长度必须在4~20位之间!"); return false;}if(passwors.length<6||password.length>20){alert("密码长度必须在6~20位之间!"); return false;}if(password!=passwoed2){alert("密码不匹配!"); return false;}if(email=""||(email.indexOf('@')==-1)||(email.indexOf('.')==-1)){alert("Email格式有误,请重新输入有效邮箱地址!"); return false;}if(question.length<4) { alert("问题长度必须大于4!"); return false; } if(answer.length<2) { alert("答案长度必须大于2!"); return false; } if(qq.length==0) { alert("请输入qq!"); return false; }if(rand.length==0) { alert("请输入验证码!"); return false;}return true;}</script> 问题补充:richard_2010 写道

解决方案

String str_qq=request.getParmaeter("qq"); //这行拼写错误

时间: 2024-07-28 16:56:53

The method getParmaeter(String) is undefined for the type HttpServletRequest的相关文章

java sting split- The method sqlit(String) is undefined for the type String

问题描述 The method sqlit(String) is undefined for the type String 小弟新手!!!split()函数以前用的好好地!今天突然直接就报个这么个错误!!看了半天没发现错误!用法跟以前一模一样啊!为什么会报错呢!!导致jsp页面无法编译!传递参数为:&steelmar=YT201%20,%20Ф5.5-Ф20 报错代码String[] ms = electty.sqlit(",");!!!!求高人指点迷津啊!!!!!!!!!!

The method getResources() is undefined for the type

在非activity的独立类(public class readwhatsapp)中调用getResources()时(InputStream is = getResources().openRawResource(R.raw.wa_contacts.db)),出现The method getResources() is undefined for the type 这是因为 getResources() 其实是contex中传递过去的,在非activity类中没有找到可以传递的cavas 解决

The method getconn() is undefined for the type words

问题描述 为什么我明明定义了方法,还回出现错误??包contorl下有两个类,一个accessdb类,一个words类继承accessdb:而在jsp调用words这个javabean但是出现我没定义方法为什么???accessdb源代码:packagecontrol;importjava.sql.*;publicclassaccessdb{Connectioncon;Statementstmt;ResultSetrs;publicvoidaccessdb(){stmt=null;rs=null

The method getSingleResult() is undefined for the type Query

问题描述 关联的代码提取下 QueryResult qr = new QueryResult<T>(); Query query = this.getSession().createQuery("select count(o) from "+entityName+" o " +(wherejpql==null? "": " where "+ wherejpql)); qr.setTotalRecord(query.

The method getTextContent() is undefined for the type Node ?

问题描述 Jdk改成1.6和1.7都没用 解决方案 解决方案二:基本类型long不能为空,用对象类型应该没有问题Long.Integer解决方案三:基本类型long不能为空,用对象类型应该没有问题Long.Integer解决方案四:回错地方了

eclipse-菜鸟一枚~tv.setText(&amp;amp;quot;Hello Android-&amp;amp;quot; + new java.util.Date());这个一直报错滴说

问题描述 菜鸟一枚~tv.setText("Hello Android-" + new java.util.Date());这个一直报错滴说 小女女是菜鸟,最近刚开始看Android,这是一段疯狂Android讲义里面的代码,想试试看,发现会一直报错滴说 package com.example.helloworld; import android.app.Activity; import android.os.Bundle; import android.view.Menu; impo

jdbc-PreparedStatement pstmt = conn.prepareStatement(sql);有错误

问题描述 PreparedStatement pstmt = conn.prepareStatement(sql);有错误 PreparedStatement pstmt = conn.prepareStatement(sql); 提示:The method prepareStatement(String) is undefined for the type Connection错误,为什么?

java-实在搞不通哪错了。。望指教(在线等)(JAVA小问题)

问题描述 实在搞不通哪错了..望指教(在线等)(JAVA小问题) /**编写程序,从输入对话框读入double型的华氏度,将其转换为摄氏度,并在消息对话框中显示结果.公式如下 摄氏度=(5/9)*(华氏度-32) */ package current; import javax.swing.JOptionPane; public class ChangeTemperation { public static void main(String[] args) { double temperatio

[java初学]append方法用不了

问题描述 [java初学]append方法用不了 package javaSE2; public class StringBuilder { public static void main(String[] args){ StringBuilder builder = new StringBuilder(); builder.append("a"); } } 报错是The method append(String) is undefined for the type StringBui