JAVA:
public
enum ReimStatus { UNCONFIRMED ("118001"), //未确认 DISPATCH_VERIFY("118002"),//调度已确认; APPROVED("118003"),//已批准 FINANCE_APPROVED("118004"), //财务已批准 REJECT("118005");//已驳回 private String value; ReimStatus(String value) { this.value = value; } public String getName() { return value; } }

在JSP页面需要通过 常量来判断状态。又不想写死 if(id == '1') 例如这样的写法。
JSP中使用:
  引类:
  <%@ page import="com.shanreal.constant.ReimStatus"%>

  定义:
  <c:set var="UNCONFIRMED" value="<%=com.shanreal.constant.ReimStatus.UNCONFIRMED.getName()%>"/>
使用:
<
button type="button" class="btn btn-xs btn-success" <c:if test="${list.status ne UNCONFIRMED}"> disabled </c:if> onclick="edit(this);">编辑</button>

JS中使用:

var status = "<%=com.shanreal.constant.ReimStatus.DISPATCH_VERIFY.getName()%>";
console.log(stauts);

 

相关文章:

  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-22
  • 2021-07-17
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案