Java 无法找到复选框搜索的逻辑?

Java 无法找到复选框搜索的逻辑?,java,javascript,sql,jsp,servlets,Java,Javascript,Sql,Jsp,Servlets,这是我的HTML: <div class="float_left dshadow" style="border:1px solid gray;width:300px;height:900px;margin:40px 0 0 70px;"> <div style="width:100%;height:50px;background:black;"> <h3 class="text_center padd_top_2 color_fff">Filt

这是我的HTML:

<div class="float_left dshadow" style="border:1px solid gray;width:300px;height:900px;margin:40px 0 0 70px;">
        <div style="width:100%;height:50px;background:black;"> <h3 class="text_center padd_top_2 color_fff">Filter Products By</h3></div>
        <div class="filter_tab" id="price1">Price<i class="icon-angle-up color_0 font17 float_right" id="Up" ></i><i class="icon-angle-down color_0 font17 float_right hide" id="down" o></i></div>
        <ul class="margin_left20 list_filter" id="price_3">
            <li><input type="checkbox"  class="margin_right10" >1000-2000</li>
            <li><input type="checkbox"  class="margin_right10" >2000-3000</li>
            <li><input type="checkbox"  class="margin_right10" >3000-4000</li>
        </ul>
         <div class="filter_tab" id="size1">Size<i class="icon-angle-up color_0 font17 float_right" id="Up1" ></i> <i class="icon-angle-down color_0 font17 float_right hide" id="down1" ></i></div>
        <ul class="margin_left20 list_filter" id="size">
            <li><input type="checkbox" class="margin_right10" >Small</li>
            <li><input type="checkbox" class="margin_right10" >Medium</li>
            <li><input type="checkbox" class="margin_right10" >Large</li>
        </ul>
          <div class="filter_tab" id="brand1">Brand<i class="icon-angle-up color_0 font17 float_right" id="Up2" ></i><i class="icon-angle-down color_0 font17 float_right hide" id="down2"></i></div>
        <ul class="margin_left20 list_filter" id="brand">
            <li><input type="checkbox" class="margin_right10" >Dell</li>
            <li><input type="checkbox" class="margin_right10" >HP</li>
            <li><input type="checkbox" class="margin_right10" >Sony</li>
        </ul>
目前我正在进行此搜索,但我想在单击每个复选框时调用ajax函数并运行数据库查询和获取结果,当复选框未选中时,我想从JSP页面中删除相应的div。我在servlet上尝试了不同的逻辑,但未能获得相关结果。有人能指导我如何编码吗servlet并生成此搜索的逻辑

编辑:


基本上,我想知道在Servlet上运行哪个查询可以满足用户选择的所有复选框。

你问的是javascript代码还是服务器端代码?@Ennosigaeon服务器端代码是java代码。但是如果你能提供任何替代方法来使用客户端代码处理它,你是受欢迎的。你喜欢哪个MVC框架如果有,请使用?我知道你提到了servlet,但你是否编写了实现servlet接口的代码,还是使用了特定的框架来帮助你解决这个问题?@m4rtin我使用的是Hibernate框架,我正在为servlet实现servlet接口。我仍然不清楚你的确切问题是什么。您是否询问如何提交到服务器,单击了哪个复选框?或者您想知道如何从JSP中的数据库加载数据?