zoukankan      html  css  js  c++  java
  • EasyUI Ajax 表单

    创建form

    <divstyle="230px;background:#E0ECFF;padding:10px;">
    
        <formid="ff"action="/demo5/ProcessServlet"method="post">
    
            <table>
    
                <tr>
    
                    <td>Name:</td>
    
                    <td><inputname="name"type="text"></input></td>
    
                </tr>
    
                <tr>
    
                    <td>Email:</td>
    
                    <td><inputname="email"type="text"></input></td>
    
                </tr>
    
                <tr>
    
                    <td>Phone:</td>
    
                    <td><inputname="phone"type="text"></input></td>
    
                </tr>
    
                <tr>
    
                    <td></td>
    
                    <td><inputtype="submit"value="Submit"></input></td>
    
                </tr>
    
            </table>
    
        </form>
    
    </div>
    

    
    


    转换成Ajax表单
    我们写一些jquery代码使表单以ajax方式发送。注意,当数据返回时,form插件的success函数激发,所以我们可以处理一点事情。

    $('#ff').form({
    
        success:function(data){
    
            $.messager.alert('Info', data, 'info');
    
        }
    
    });
    
    

    服务处理:

    protectedvoiddoPost(HttpServletRequest request, HttpServletResponse response) throwsServletException, IOException {
    
        // TODO Auto-generated method stub
    
        String name = request.getParameter("name");
    
        String email = request.getParameter("email");
    
        String phone = request.getParameter("phone");
    
        System.out.println(name+":"+email+":"+phone);
    
        PrintWriter out = response.getWriter();
    
        out.print("Name:"+name+"<br/>Email:"+email+"<br/>Phone:"+phone);
    
        out.flush();
    
        out.close();
    
    }
    
    

    当我们点击发送按钮时,可以看到;

  • 相关阅读:
    tensorflow slim代码使用
    Tensorflow学习之TF-Slim的使用
    FCN用卷积层代替FC层原因(转)
    ubuntu命令查看英伟达显卡型号
    传输
    将tf-faster-rcnn检测结果画在一张图像内
    GPU跑tf-faster-rcnn demo以及训练自己的数据
    以太网适配器的驱动程序出现问题
    TensofFlow函数: tf.image.crop_and_resize
    TensorFlow函数: tf.stop_gradient
  • 原文地址:https://www.cnblogs.com/huangf714/p/5911792.html
Copyright © 2011-2022 走看看