Java EL对象`$ {pools}`

时间:2011-10-03 18:46:02

标签: java jsp jstl el

我正在尝试调整PSI Probe中使用的代码(或更一般地说,PSI Probe的概念),以便在我公司的Web应用程序中使用。我可以获得我想要做的大部分内容,但是我已经陷入了一些代码 - “状态”选项卡。一列数据是线程的处理时间,我真的想要的数据,但我无法弄清楚它来自何处。这是相关的片段:

<c:forEach items="${pools}" var="pool" varStatus="poolStatus">
  <div class="poolInfo">
    <h3>${pool.name}</h3>
    <div class="processorInfo">
      <span class="name">
        <spring:message code="probe.jsp.status.processor.maxTime"/>
      </span>
      &nbsp;${pool.maxTime}

我无法弄清pools对象的来源!有没有人有这种经历?谢谢!

2 个答案:

答案 0 :(得分:3)

查看源代码(这是Google代码,Google搜索工作非常快)

正在ListThreadPoolsController

中填充池
List pools = containerListenerBean.getThreadPools();
        return new ModelAndView(getViewName())
                .addObject("pools", pools);

仔细查看ContainerListenerBean

显示status.jsp

中列出的属性
<span class="name"><spring:message code="probe.jsp.status.currentThreadCount"/></span>&nbsp;${pool.currentThreadCount}
<span class="name"><spring:message code="probe.jsp.status.currentThreadsBusy"/></span>&nbsp;${pool.currentThreadsBusy}
<span class="name"><spring:message code="probe.jsp.status.maxThreads"/></span>&nbsp;${pool.maxThreads}
<span class="name"><spring:message code="probe.jsp.status.maxSpareThreads"/></span>&nbsp;${pool.maxSpareThreads}
<span class="name"><spring:message code="probe.jsp.status.minSpareThreads"/></span>&nbsp;${pool.minSpareThreads}

正在getThreadPools()方法

中填充
ThreadPool threadPool = new ThreadPool();
threadPool.setName(executorName.getKeyProperty("name"));
threadPool.setMaxThreads(JmxTools.getIntAttr(server, executorName, "maxThreads"));
threadPool.setMaxSpareThreads(JmxTools.getIntAttr(server, executorName, "largestPoolSize"));
threadPool.setMinSpareThreads(JmxTools.getIntAttr(server, executorName, "minSpareThreads"));
threadPool.setCurrentThreadsBusy(JmxTools.getIntAttr(server, executorName, "activeCount"));
threadPool.setCurrentThreadCount(JmxTools.getIntAttr(server, executorName, "poolSize"));

答案 1 :(得分:2)

一般来说,它可能来自两个地方。在JSP或Filter之前调用的Servlet。检查所有过滤器,并将servlet映射到您要打开的URL。