how to redirect to struts action from javascript in struts 2?

前端 未结 3 1300
北海茫月
北海茫月 2021-01-19 10:44

how to redirect to struts action from java script?

if condition in the script got success then i need to invoke one action in the config xml, otherwise no action inv

3条回答
  •  不思量自难忘°
    2021-01-19 11:22

    try is:

    function displayDate(){
    
        var x=document.getElementsByName("userName")
        if(x = "shan")
        {   
        alert("shankarasd");
        document.myForm.action ="/setUpForInsertOrUpdate";
        document.myForm.submit();
    
    
        location.href = "nameaction.action?parameter1="+value1+"¶meter2="+value2;
        }
    
    }
    

提交回复
热议问题