不支持post请求???这是什么意思,试着request呢?

解决方案 »

  1.   

    这个是test.jsp<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    <table width="95%" border="0" align="center" cellpadding="2" cellspacing="2">
      <form name="frmReg" method="post" action="person_regsave.jsp">
        <tr> 
          <td height="40">&nbsp;</td>
          <td height="40">&nbsp;</td>
          <td height="40">&nbsp;</td>
        </tr>
        <tr> 
          <td width="25%" height="40" align="right">用户名:</td>
          <td width="38%" height="40"> <input name="UserName" type="text" class="input" id="UserName" size="15" maxlength="20"></td>
          <td width="37%" height="40">[<a href="#" target="_blank"><font color="#0099FF">检查用户是否已经存在</font></a>]</td>
        </tr>
        <tr> 
          <td height="40" align="right">密码:</td>
          <td height="40"> <input name="Password" type="password" class="input" id="Password" size="15" maxlength="20"></td>
          <td height="40">&nbsp;</td>
        </tr>
        <tr> 
          <td height="40" align="right">密码确认:</td>
          <td height="40"> <input name="PasswordAffirm" type="password" class="input" id="PasswordAffirm" size="15" maxlength="20"></td>
          <td height="40">&nbsp;</td>
        </tr>
        <tr> 
          <td height="40" align="right">取回密码问题:</td>
          <td height="40"> <input name="PasswordQuestion" type="text" class="input" id="PasswordQuestion" size="20" maxlength="30"></td>
          <td height="40">&nbsp;</td>
        </tr>
        <tr> 
          <td height="40" align="right">取回密码答案:</td>
          <td height="40"> <input name="PasswordAnswer" type="text" class="input" id="PasswordAnswer" size="20" maxlength="30"></td>
          <td height="40">&nbsp;</td>
        </tr>
        <tr> 
          <td height="40" align="right">E-mail:</td>
          <td height="40"> <input name="Email" type="text" class="input" id="Email" size="20" maxlength="50"></td>
          <td height="40">&nbsp;</td>
        </tr>
        <tr align="center"> 
          <td height="40" colspan="3"> <input type="submit" name="Submit" value="提交"> 
            &nbsp; <input type="submit" name="Submit2" value="提交"></td>
        </tr>
      </form>
    </table>
    </body>
    </html>提交给这个
    <%@ page contentType="text/html;charset=gb2312" %>
    <%@ include file="include/inc.jsp"%>
    <%try{
    String UserName = new String(request.getParameter("UserName").getBytes("ISO8859_1"),"GBK");
    String Password = new String(request.getParameter("Password").getBytes("ISO8859_1"),"GBK");
    String PasswordAffirm = new String(request.getParameter("PasswordAffirm").getBytes("ISO8859_1"),"GBK");
    String PasswordQuestion = new String(request.getParameter("PasswordQuestion").getBytes("ISO8859_1"),"GBK");
    String PasswordAnswer = new String(request.getParameter("PasswordAnswer").getBytes("ISO8859_1"),"GBK");
    String Email = new String(request.getParameter("Email").getBytes("ISO8859_1"),"GBK");
    PersonUser personUser= new PersonUser();
    personUser.setUserName(UserName);
    personUser.setPassword(Password);
    personUser.setPasswordQuestion(PasswordQuestion);
    personUser.setPasswordAnswer(PasswordAnswer);
    personUser.setEmail(Email);
    personUser.addUser();
    }
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    <%
    catch(Exception e){
    out.println("错误信息:"+e.getMessage());
    }
    %>
    </body>
    </html>为什么?
      

  2.   

    PersonUser personUser= new PersonUser();
    personUser.setUserName(UserName);
    personUser.setPassword(Password);
    personUser.setPasswordQuestion(PasswordQuestion);
    personUser.setPasswordAnswer(PasswordAnswer);
    personUser.setEmail(Email);
    personUser.addUser();哪里来的Bean ? Struts ?
      

  3.   

    把变量的声明写在try{}catch(){}之外,try和catch中间不能插入其他东西!
      

  4.   

    又出现新问题了:问题一:
    我写了一个Beans(PersonUser)放在web-inf/classes里,原来还能用的,后来我在里面添加了一个方法,然后又把编译后的class文件放到里面,还把原文放到里了,重启了一次,然后却发现用不了新写的方法,这是为什么?
    问题二:
    我在web-inf/classes/com/newben/person 有一个Person.classinc.jsp里有这句
    <%@ page import="com.newben.person.*">在page.jsp页面里有这句
    <%@ include file="inc.jsp"%>但是在后面的页面里直接用 Person p = new Person();却提示说找不到class 这又是为什么?