I have two jsp pages in my spring project. In first jsp I have one dynamic dropdown list and one link tag which directs to second jsp page. I want to pass the selected item of dropdown list to second jsp. So how can I pass parameter as selected value in href and how can I get the value in second jsp.
我的春季项目中有两个jsp页面。在第一个jsp中,我有一个动态下拉列表和一个指向第二个jsp页面的链接标记。我想将选定的下拉列表项传递给第二个jsp。那么如何在href中将参数作为选定值传递,如何在第二个jsp中获取该值。
<form:select id="Id" path="Id">
<form:options items="${IdList}">
</form:select>
<a href="<%=basepath%>secondpage"> Second Page </a>
1 个解决方案
#1
0
Because u want to pass it via the a tag, href attribute, add a onchange handler on your select tag, then at that handler modify the href attribute of the second page link. You should use javascript.
因为你想通过a标签,href属性传递它,在你的select标签上添加一个onchange处理程序,然后在那个处理程序中修改第二页链接的href属性。你应该使用javascript。
#1
0
Because u want to pass it via the a tag, href attribute, add a onchange handler on your select tag, then at that handler modify the href attribute of the second page link. You should use javascript.
因为你想通过a标签,href属性传递它,在你的select标签上添加一个onchange处理程序,然后在那个处理程序中修改第二页链接的href属性。你应该使用javascript。