Java定义常量以及在jsp使用常量

来源:互联网 发布:linux如何修改内核参数 编辑:程序博客网 时间:2024/05/22 15:32
public enum PlatformConstants {        KING("8"),               CAT("9"),                                         private String value;                  PlatformConstants(String value) {              this.value = value;          }                    public String getName() {              return value;          }      }



<%@page import="com.vip.mlisting.constants.PlatformConstants"%><%@include file="../main/header.jsp"%><%String path = request.getContextPath();%><!-- app 常量 --><c:set var="KING" value="<%=SalePlatformConstants.KING.getName()%>"/><c:set var="CAT" value="<%=SalePlatformConstants.CAT.getName()%>"/>

<c:if test ="${KING==params['platform']}"><th>档期说明</th></c:if><th>图片预览</th><th>档期商品</th><c:if test ="${CAT==params['platform']}"><th>子类型</th></c:if>


0 0
原创粉丝点击