简体   繁体   中英

how to pass dropdown selected value from one jsp to another in springs

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.

<form:select id="Id" path="Id">
        <form:options items="${IdList}">
    </form:select>

    <a href="<%=basepath%>secondpage"> Second Page </a>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM