您的位置:首页 > 其它

Form表单提交

2016-05-26 15:29 651 查看
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%@taglib prefix="cm" uri="/WEB-INF/tld/cm.tld" %>

<!DOCTYPE html>

<html lang="zh">

    <head>

        <title><fmt:message key="title"/></title>

        <%@include file="../common/head.jspf" %>

        <link rel="stylesheet" href="css/daterangepicker.css" />

    </head>

    <body class="navbar-fixed">

        <%@include file="../common/navbar.jspf" %>

        <div class="container-fluid main-container" id="main-container">

            <%@include file="../common/sidebar.jspf" %>

            <div id="main-content" class="clearfix main-content">

                <div id="breadcrumbs" class="breadcrumbs">

                    <ul class="breadcrumb">

                        <li>

                            <i class="icon-home home-icon"></i> <a href="dashboard">首页</a>

                            <span class="divider">

                                <i class="icon-angle-right"></i>

                            </span>

                        </li>

                        <li>

                            贷后管理

                            <span class="divider">

                                <i class="icon-angle-right"></i>

                            </span>

                        </li>

                        <li class="active">本日到期欠款</li>

                    </ul><!--.breadcrumb-->

                </div><!--#breadcrumbs-->

                <div id="page-content" class="clearfix page-content">

                    <div class="row-fluid">

                        <div class="widget-box transparent span-12">

                            <div class="widget-header">

                                <h4>

                                    <i class="icon-table"></i>本日到期欠款(含延期欠款)

                                </h4>

                                <form action="postLoan/todayQuery" class="pull-right no-margin form-horizontal" method="POST">

                                    <div class="control-group pull-right">

                                        <button class="btn btn-small btn-primary" id="searchHistory">查询</button>

                                        <a class="btn btn-small btn-danger downloadLink"

                                                id="downloadHistory"

                                                href="">下载

                                        </a>

                                    </div>

                                    <div class="control-group pull-right">

                                        <label for="queryCondition" class="control-label">标的号/工号/登录名</label>

                                        <div class="controls">

                                            <input type="text" name="queryCondition">

                                        </div>  

                                    </div>

                                </form>

                            </div>

                            <div class="widget-body">

                                <div class="widget-main no-padding">

                                    <table class="table table-bordered table-striped">

                                        <thead>

                                            <tr>

                                                <th>

                                                    <i class="icon-star-empty"></i>

                                                    状态

                                                </th>

                                                <th>

                                                    <i class="icon-user"></i>

                                                    借款人

                                                </th>

                                            </tr>

                                        </thead>

                                        <tbody>

                                            <c:forEach var="repay" items="${it.entity}">

                                                <tr>

                                                    <td>

                                                        ${repay.status.key}

                                                    </td>

                                                    <td>

                                                        <a href="user/${repay.user.id}">

                                                            ${repay.user.loginName}

                                                        </a>

                                                    </td>

                                                </tr>

                                            </c:forEach>

                                        </tbody>

                                    </table>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

  

        <%@include file="../common/foot.jspf" %>

        <script type="text/javascript" src="js/amountFormat.js"></script>

        <script type="text/javascript">

            $('#downloadHistory').click(function() {

                var params = {

                   queryCondition: $('input[name=queryCondition]').val()

               };

               $(this).attr("href","postLoan/downloadTodayLoans?".concat($.param(params)));     

           });

        </script>

    </body>
</html>

标红的form表单提前到后台:只能是@POST

    @POST

    @Path("/todayQuery")


    public Response today(@FormParam("queryCondition") String queryCondition) {

           。。。。。。。

        repayExt = enrich(totalRepayments); //返回给页面遍历展示的值

        return forward("/postLoan/today", repayExt);

    }

下载的后台:只能是@GET

    @GET

    @Path("/downloadTodayLoans")

    @Produces(MediaType.APPLICATION_JSON)

    public Response downloadTodayLoans(@QueryParam("queryCondition") String queryCondition) throws IOException { }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: