簡體   English   中英

如何使.jsp使用Eclipse Google App Engine調用方法

[英]how to make an .jsp invoke a method using eclipse Google app engine

你好,我的項目調用功能有問題![在此處輸入圖片描述]

<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);
    }

}

我對注冊進行了表單操作並調用了函數post,但是單擊sumbit時似乎不起作用,我不知道為什么。

首先嘗試在最后一個輸入中正確輸入“提交”,如果不起作用,請嘗試將最后一個輸入的類型改為“提交”而不是“按鈕”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM