Search code examples
javastruts

How to forward control to Div tag using struts-xml file


I am having tabbed HTML with three Tabs.

How can i transfer control to another tabs, i am using Struts 1.3 framework.

<action name="AcquisitionForm" path="/Acquition" type="com.woi.action.AcquitionAction" validate="false"> 
       <forward name="pcdemo" path="/Main.jsp#tab2" />
</action>

Solution

  • @niraj deshmukh There is nothing to do with Struts-config.xml file. This will only takes you to the main.jsp page. You got to do some javascript/jQuery works to select second tab. I am not sure what kind of tab you are using. Here i shown the selecting particular(2/3) jQuery tab.

    $( document ).ready(function() {
     $("#tabs").tabs({ active: 2 });
    });
    

    But this code will do everytime tab2 selected. You need to change this code according to your need. Refer this selecting a specific jquery tab on page load and default tab on page load using jquery for more information. Hope this help you.