zoukankan      html  css  js  c++  java
  • 从控制层传三个及以上不同类型的值到页面

    方法一:封装成一个临时实体类。

    方法二:将这些值用json(JSONObject)转换成字符串形式,然后在通过json(JSON.parse)转换成Map,放入Map或List集合中。

    例:1.控制层

    Map<String,Map<String,String>> maps=new
    HashMap<String,Map<String,String>>();
    for (CoinProps newCoins : digtalCoinsNew) {
    	boolean isFixedTimeLimit = limitService.isLimitCoinType(newCoins);
    	String coinName = newCoins.getEnname();
    	if ( isFixedTimeLimit ){
    		fixedTimeLimitCoins.append(fixedTimeLimitCoins.length() > 0 ? "," : "").append(coinName);
    	}
    	UserWithdrawLimit uwl = uwlDao.getByUser(userId, newCoins);
    	JSONObject json = new JSONObject();
    	json.put("name", coinName);
    	json.put("timeLimit", isFixedTimeLimit);
    	json.put("withdrawLimit", uwl);
    	String string = json.toString();
    	Map map=(Map)com.alibaba.fastjson.JSON.parse(string);
    	maps.put(coinName, map);
    }
    

      2.页面

    <c:forEach items="${limit }" var="limit">
    <c:if test="${ !limit.value.timeLimit }">
          <span class="s2">
              ${limit.value.name }单笔限额:<em class="green"><fmt:formatNumber value="${limit.value.withdrawLimit.everyTimeAmount}" pattern="#.##"/></em>
              <a href="javascript:dayCashNew('${user.id}','everyTimeAmount','${limit.value.name }','${limit.value.withdrawLimit.userId}')"> 修改</a>
          </span>
          <span class="s2">
              ${limit.value.name }单日限额:<em class="green"><fmt:formatNumber value="${limit.value.withdrawLimit.everyDayAmount}" pattern="#.##"/></em>
              <a href="javascript:dayCashNew('${user.id}','everyDayAmount','${limit.value.name }','${limit.value.withdrawLimit.userId}')"> 修改</a>
            </span>
    </c:if>
    </c:forEach>
    

      3.附

    @Entity
    public class UserWithdrawLimit extends StrBaseLongIdEntity {
    
        private static final long serialVersionUID = -2386115543279873656L;
        /**当为0时,表示默认全局设置*/
        private int userId;
        /**币种类型,参见CoinProps的fundsType*/
        private int fundsType;
        /**单笔提现额度*/
        private String everyTimeAmount;
        /**单日提现额度*/
        private String everyDayAmount;
        /**单日免审提币额度*/
        private String dayFreeCash;
       
        public UserWithdrawLimit() {
        }
    
        public UserWithdrawLimit(Datastore ds) {
            super(ds);
        }
      
        .........
    

      

  • 相关阅读:
    线程池的扩展 beforeExecute() afterExecute() terminaerd()
    信号量semaphore 读写锁ReadWriteLock 倒计时器CountDownLatch 循环栅栏 CyclicBarrier 线程阻塞工具类LockSupport
    ReenTrantLock可重入锁 和synchronized 内部所锁的
    integer.valueof和integer.parseint
    守护线程
    notify wait sleep join yield yield
    Thread.stop()不要随意调用
    iterate使用了parallel() 反而消耗了更多的时间
    Stream 分支/合并 框架的实际例子
    区分Collection、Collector和collect Collectors类的静态工厂方法
  • 原文地址:https://www.cnblogs.com/heinight/p/7373695.html
Copyright © 2011-2022 走看看