2010-12-08 6 views
6

estoy recibiendoPrimeros igual símbolo de espera durante el uso de jstl

org.apache.jasper.JasperException: /WEB-INF/AllClientBatchDetails.jsp(54,103) igual símbolo de espera

Y aquí está la JSP

<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> 
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 


<html:html xhtml="true"> 
<head> 
<title><bean:message key="progressReporter.successpage.title"/></title> 
<link rel="stylesheet" href="style.css">  
<html:base/> 
</head> 
<body> 
<c:choose> 
    <c:when test="${empty batchProgressMetricsList}"> 
    <font color=<bean:message key="error.font.color" /> size=<bean:message key="error.font.size" />> 
    <bean:message key="error.no.active.batch" /> 
    </font> 
    <br/> 
    </c:when> 
    <c:otherwise> 
    <h4><bean:message key="table.header" /></h4> 
    <table border=<bean:message key="table.border.size" />> 
    <tr> 
    <th><bean:message key="table.client.id.header" /></th> 
    <th><bean:message key="table.total.session.used" /></th> 
    <th><bean:message key="table.total.time.elapsed" /></th> 
    <th><bean:message key="table.imnts.completed" /></th> 
    <th><bean:message key="table.imnts.remaining" /></th> 
    <th><bean:message key="table.cores.allocated" /></th> 
    <th><bean:message key="table.time.remaining" /></th> 
    </tr> 
    <c:forEach var="aggregatedBatchProgressMetrics" items="${batchProgressMetricsList}"> 
    <tr> 
     <td class="tdcenter">${aggregatedBatchProgressMetrics["clientId"]}</td>   
     <td class="tdcenter">${fn:substringBefore(aggregatedBatchProgressMetrics["sessionStats"]["sessionUsedTime"]/60000, '.')}mins${fn:substringBefore((aggregatedBatchProgressMetrics["sessionStats"]["sessionUsedTime"] % 60000)/1000, '.')}secs </td> 
     <td class="tdcenter">${fn:substringBefore(aggregatedBatchProgressMetrics["sessionStats"]["totalElapsedTime"]/60000, '.')}mins${fn:substringBefore((aggregatedBatchProgressMetrics["sessionStats"]["totalElapsedTime"] % 60000)/1000, '.')}secs</td> 
     <td class="tdcenter">${aggregatedBatchProgressMetrics["instrumentStats"]["totalImntsCompleted"]}</td> 
     <td class="tdcenter">${aggregatedBatchProgressMetrics["instrumentStats"]["totalImntsRemaining"]}</td> 
     <td class="tdcenter">${aggregatedBatchProgressMetrics["numberOfCores"]}</td> 
     <td class="tdcenter">${fn:substringBefore(aggregatedBatchProgressMetrics["sessionStats"]["sessionRemainingTime"]/60000, '.')}mins${fn:substringBefore((aggregatedBatchProgressMetrics["sessionStats"]["sessionRemainingTime"] % 60000)/1000, '.')}secs</td> 
     <br/> 
     <table> 
     <tr> 
     <th>session Id</th> 
     <th>taskId</th> 
     <th>task start time</th> 
     <th>task end time</th> 
     </tr>   
     ${aggregatedBatchProgressMetrics["batchMetricsList"][0]} 
     ${aggregatedBatchProgressMetrics["batchMetricsList"][1]} 
     ${aggregatedBatchProgressMetrics["batchMetricsList"][2]} 

     <c:forEach var="batchProgressMetrics" items="${aggregatedBatchProgressMetrics["batchMetricsList"]}"> 
     <tr> 
      <td class="tdcenter">${batchProgressMetrics["taskStats"]["sessionId"]}</td> 
      <td class="tdcenter">${batchProgressMetrics["taskStats"]["taskId"]}</td> 
      <td class="tdcenter">${batchProgressMetrics["taskStats"]["taskStartTime"]}</td> 
      <td class="tdcenter">${batchProgressMetrics["taskStats"]["taskEndTime"]}</td> 
     </tr> 
     </c:forEach>   
     </table> 
     <br/> 
    </tr> 
    </c:forEach> 
    </table> 
    </c:otherwise> 
</c:choose> 
<html:link page="/ProgressReporterForm.jsp">Go Back</html:link> 
</body> 
</html:html> 

tengo solicitud atributo establece en batchProgressMetricsList y su una lista de selección de un objeto llamado. Tengo AggregatedBatchProgressMetrics. Dentro de aggregatedBatchProgressMetrics tengo un método llamado getBatchMetricsList que devuelve un arraylist del objeto llamado BatchProgressMetrics. Si lo ejecuto sin la etiqueta anidada c:forEach, simplemente funcionaría bien, pero si incluyo el anidado, simplemente falla. ¿Alguien puede ayudarme?

Gracias de antemano. Almas

+1

No tratar de XML-Escape sus ejemplos de código, de SO editor puede hacer un trabajo mucho mejor. Lo que has publicado no se puede leer. – skaffman

Respuesta

5

Reemplazar

<c:forEach var="batchProgressMetrics" items="${aggregatedBatchProgressMetrics["batchMetricsList"]}"> 

por

<c:forEach var="batchProgressMetrics" items="${aggregatedBatchProgressMetrics['batchMetricsList']}"> 

El comillas dobles estaba cerrando el valor items demasiado pronto lo que resultó en EL válido. Deberías haber detectado esto lo suficientemente pronto cuando utilizas un editor con resaltado decente sytnax (como aquí en SO :)).

11

trate de cambiar esto:

items="${aggregatedBatchProgressMetrics["batchMetricsList"]}" 

a esto:

items="${aggregatedBatchProgressMetrics['batchMetricsList']}" 
+0

Gracias chicos ... esto funcionó .. – Almas

+1

@ Almas que por qué esto no está marcado como una respuesta? Sería bueno. –

Cuestiones relacionadas