本帖最后由 skyair2004 于 2009-08-13 19:14:35 编辑

解决方案 »

  1.   

    这就要看你提交到哪儿了
    要是servlet的话可以用request.getParameter来取得
      

  2.   


    能给点势利代码吗
    随便提交到那里都可以
    我想是提交到bean里面做对比
    如果比是数据库里面的就返回一个false过来
    跳转到本来的页面
    如果成功就跳到管理页面
      

  3.   

    1.jsp中
    <input type="text" name = "test">
    提交的sevlet中
    String save =  request.getParameter("test");
    request.setAttribute("save" save);
    ----index.jsp
    String save = request.getAttribute("save");
    <input type="text" name = "test" value="<%=sava%">
    也可以直接
    <input type="text" name = "test" value="${requestScope.save}">这是没用框架的情况,用struts要很简单
      

  4.   

     String save =  request.getParameter("test");
    这句写那里啊
      

  5.   

    在index.jsp中,
    <%
     String value = request.getParameter("value");
    %>括号内的value是你表单提交过来的数据。
      

  6.   

    <!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 type="text/css">
    <!--
    .STYLE1 {color: #FFFFFF}
    -->
    </style>
    </head><body><form action="ServletFrom.java" name="toland" method="post"><table width="453" border="1">
      <tr>
        <td width="182">管理员登陆:</td>
        <td width="255" colspan="2"><span class="STYLE1"></span><span class="STYLE1"></span><span class="STYLE1">
          <label>
          <input type="text" name="myname" />
          </label>
        </span></td>
        </tr>
      <tr>
        <td>密码:</td>
        <td colspan="2"><label>
          <input type="password" name="password" />
        </label></td>
      </tr>
      <tr>
        <td colspan="3"><label>
          <input type="submit" name="Submit" value="提交" />
        </label>
          <label>
          <input type="reset" name="Submit2" value="重置" />
          </label></td>
        </tr>
    </table>
    </form>
    </body>
    </html>
    package com.way.servlet;import java.io.IOException;
    import java.io.PrintWriter;import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;public class ServletFrom extends HttpServlet { /**
     * Constructor of the object.
     */
    public ServletFrom() {
    super();
    } public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {

    } public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String save = request.getParameter("myname");
    System.out.println(save); }}这那里写错了吗?
    表单里面的那个值应该传过来了吧?
    老是报错哦