Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将列表中的特定值传递给控制器Spring MVC_Spring - Fatal编程技术网

将列表中的特定值传递给控制器Spring MVC

将列表中的特定值传递给控制器Spring MVC,spring,Spring,在我的jsp页面中有这样一个表 <c:if test="${not empty resultMap}"> <table> <tr> Id: </tr> <tr> Name: </tr> <tr> Date: </tr>

在我的jsp页面中有这样一个表

<c:if test="${not empty resultMap}">
    <table>
        <tr>
            Id:
        </tr>
        <tr>
            Name:
        </tr>
        <tr>
            Date:
        </tr>
    <c:forEach items="${resultMap}" var="result">
        <tr>
            <td>
                ${result.entryId}
            </td>
            <td>
                ${result.entryName}
            </td>
            <td>
                ${result.entryDate}
            </td>
            <td>
                <a href="viewEntry.htm">View</a><
            </td>
        </tr>
    </c:forEach>
    </table>
</c:if>
现在我的要求是在另一个页面中显示条目详细信息。也就是说,当在Id为1的条目上单击“查看”链接时,我需要在单独的页面中显示其详细信息

那么,如何将单击其“视图”链接的resultMap和entryId传递给控制器

这可以通过SpringMVC实现吗?还是应该使用ajax或jquery等其他技术

谢谢,
Midhun

您没有通过结果映射。您只传递条目的ID:

<a href="<c:url value='viewEntry.htm'>
             <c:param name='entryId' value='${result.entryId}'>
         </c:url>">View</a><

这是工作,并得到它作为一个字符串。那么我们如何传递结果对象呢?结果在您的数据库中。为什么要从浏览器传递它?
<a href="<c:url value='viewEntry.htm'>
             <c:param name='entryId' value='${result.entryId}'>
         </c:url>">View</a><
<a href="viewEntry/${entryId}.htm">View</a>