关于jsp页面到页面传值

  很久没用这种传值了,一般都是一个.do请求到后台在跳转到前端;像有些只是展示数据功能,这样做就显得没有必要,闲话不说了,记录下来供下次参考。

用的是html的a标签,我这里只用这2种用法。

场景如下图:

1:点击支取

第一种方式在a标签内设置参数,就是json对象,键值对

 <a href="#" class="a_a" onclick="judge(this); return false;"
     params="({
                                agreeNo:'<c:out value="${protocol.agreeNo}" />',
                                acctNo:'<c:out value="${protocol.acctNo}" />',
                                cardNo:'<c:out value="${protocol.cardNo}" />',
                                dspNo:'<c:out value="${protocol.dspNo}" />',
                                drCrAcctno:'<c:out value="${protocol.drCrAcctno}" />',
                                drCrCardNo:'<c:out value="${protocol.drCrCardNo}" />',
                                bussType:'<c:out value="${protocol.bussType}" />',
                                currencyType:'<c:out value="${protocol.currencyType}" />',
                                maturityDate:'<c:out value="${protocol.maturityDate}" />',
                                agreeAmt:'<fmt:formatNumber pattern="0.00" value="${protocol.amt}"/>',
                                limitDays:'<c:out value="${protocol.limitDays}" />',
                                depositRate:'<fmt:formatNumber pattern="0.00" value="${protocol.depositRate}"/>',
                                lendingRate:'<fmt:formatNumber pattern="0.00" value="${protocol.lendingRate}"/>',
                                discountLendingRate:'<fmt:formatNumber pattern="0.00" value="${protocol.discountLendingRate}"/>',
                                openDate:'<c:out value="${protocol.openDate}" />',
                                monthTerm:'<c:out value="${protocol.monthTerm}" />',
                                monthTermDesc:'<c:out value="${protocol.monthTermDesc}" />'
                                })">支取</a>

附带1方法:

function judge(obj) {
  params = eval( obj.params );

  var today = '<c:out value="${queryDTO.today}" />';
  var openDate = params['openDate'];

  if (today>=openDate) {
   withdraw(obj);
         return false;
  } else {
         var hrefz="<c:url value='/work/transfer/flexible_fixed_withdraw_tip.jsp'/>?openDate=" + openDate;
    $.pa_ui.dialog.open({
            url:hrefz,
            position:[50,20],
            title:'支取提示',
            frameOverlay:true,
            width:600,
            height:250,
            modal:true,
            minimize:false,
            maximize:false
            });
            return false;
  }
}


   2:点击详情

这种方式就是直接调用事件中的方法传值,也是json传值

  <a href="#" class="a_a" onclick="detailQry({
                        acctNo:'<c:out value="${protocol.cardNo}" />',
                        dspNo:'<c:out value="${protocol.dspNo}" />',
                        amt:'<fmt:formatNumber pattern="0.00" value="${protocol.amt}"/>',
                        monthTerm:'<c:out value="${protocol.monthTermDesc}" />',
                        effDate:'<c:out value="${protocol.effDate}" />',
                        maturityDate:'<c:out value="${protocol.maturityDate}" />',
                        openDate:'<c:out value="${protocol.openDate}" />'
                        }); return false;"
     >详情</a>

 

附带2方法:

function detailQry(obj){
        var hrefz="<c:url value='/work/transfer/flexible_fixed_protocol_detail.jsp'/>?"+$.param(obj);
        $.pa_ui.dialog.open({
            url:hrefz,
            position:[50,20],
            title:'灵活定存协议详情',
            frameOverlay:true,
            width:650,
            height:500,
            modal:true,
            minimize:false,
            maximize:false
            });
        return false;
    }

 

 在另一个jsp页面都是一样的,显示用el标签param对象点对应的字段

<c:out value="${param.xxx}" />

 

posted on 2014-09-19 10:36  花生之恋  阅读(744)  评论(0编辑  收藏  举报

导航