【问题标题】:how to make an .jsp invoke a method using eclipse Google app engine如何使用 Eclipse Google 应用引擎让 .jsp 调用方法
【发布时间】:2015-04-23 06:36:43
【问题描述】:

您好,我在我的项目中调用函数时遇到问题![在此处输入图像描述]

<form action="register" method="post">
    <table>
      <tr>
        <td colspan="2" style="font-weight:bold;">UserID:</td><td><input type="text" name="Id"></td>
        </tr>
        <tr>
        <td colspan="2" style="font-weight:bold;">Name :</td><td><input type="text" name="name"></td>
        </tr>
        <tr>
        <td colspan="2" style="font-weight:bold;">Password</td><td><input type="password" name="pass"></td>
        </tr>
        <tr>
         <td><input type="button"  value="sumbitk"></td>     
      </tr>
    </table>
    </form>
    <hr>

$

    public void doGet(HttpServletRequest req, HttpServletResponse resp)
                    throws IOException {
            resp.setContentType("text/plain");
            resp.getWriter().println("Hello, world");
    }

    public void doPost(HttpServletRequest req, HttpServletResponse resp)
                    throws IOException, ServletException {
        //RequestDispatcher dispatcher;
        String id=req.getParameter("id");
        String name=req.getParameter("name");
        String password=req.getParameter("pass");
        System.out.println("user id : "+id+" name    "+name+" pass "+password);
        resp.sendRedirect("/index.html");
        //dispatcher=getServletContext().getRequestDispatcher("/index.html");
        //dispatcher.forward(req, resp);
    }

}

我在 register 上进行了表单操作并调用了函数 post,但是当我单击 sumbit 时它似乎不起作用,我不知道为什么。

【问题讨论】:

    标签: java eclipse jsp google-app-engine call


    【解决方案1】:

    首先尝试在最后一个输入中正确写入“提交”,如果不起作用尝试将最后输入的类型更改为“提交”而不是“按钮”

    【讨论】:

      猜你喜欢
      • 2012-11-12
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      • 2016-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多