简体   繁体   中英

How to redirect in same tab in after form submisson inspring mvc controller

Here,I have created multiple table in single jsp page. Each tabs had a different forms, If i submit the 2nd tab form it will be move on first tab.I don;t want move on first tab.It will be held on Second Tab.

<ul class="nav nav-tabs">

  <li class="active"><a  href="#tab1" data-toggle="tab" aria-expanded="true">Home</a></li>
  <li class=""><a href="#tab2" data-toggle="tab" aria-expanded="false">About</a</li>
 <li class=""><a href="#tab3" data-toggle="tab" aria-expanded="false">Settings</a></li>
  <li class=""><a href="#tab4" data-toggle="tab" aria-expanded="false">Contact </a> </li>
</ul>

You can dynamically activate your tab by using the method

function activaTab(tabId){
    $('.nav-tabs a[href="#' + tabId + '"]').tab('show');
};

Now call the method and activate your tab like

activaTab('tab1');
activaTab('tab2');
activaTab('tab3');

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