Pessoal boa noite, estou tentando passar esse id via sendPost "${analitico.idH2H}" e ele esta indo como NULL, porém visualizando a tabela, o valor esta la, alguém pode me ajudar, talvez algo esteja passando ai
HTML
<tbody>
<c:forEach items="${analitico}" var="analitico">
<tr>
<td style="display:none;"><span>${analitico.idH2H}</span></td>
<td><span>${analitico.jogadorTemp}</span></td>
<td><span class="label label-success">${analitico.placar1}</span></td>
<td><span class="label label-danger">${analitico.placar2}</span></td>
<td><span>${analitico.oponenteTemp}</span></td>
<td><a onclick="sendPost('relatorio-analitico-d', {id: ${analitico.idH2H}});"><i class="dripicons-folder-open"></i></a></td>
</tr>
</c:forEach>
</tbody>
JS
if (!window.sendPost) {
window.sendPost = function (url, obj) {
//Define o formulário
var myForm = document.createElement("form");
myForm.action = url;
myForm.method = "post";
for (var key in obj) {
var input = document.createElement("input");
input.type = "text";
input.value = obj[key];
input.name = key;
myForm.appendChild(input);
}
//Adiciona o form ao corpo do documento
document.body.appendChild(myForm);
//Envia o formulário
myForm.submit();
};
}
ERRO
04-Dec-2017 19:54:11.421 SEVERE [http-nio-8084-exec-11] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [dispatcher] in context with path [/Head2Head] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Optional int parameter 'oponente' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.] with root cause
java.lang.IllegalStateException: Optional int parameter 'oponente' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.