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

前端 未结 3 1304
北海茫月
北海茫月 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:37

    you can call action controller with parameter on click event

    $('#loginSubmit').click(function(){ 
    
    var Username= take the value for text fields 
    
    var Password =take the value for text fields 
    var url = "login"; 
    
    var FormD = '
    '; FormD += ''; FormD += ''; FormD += '
    '; $("body").append(FormD); $("#frmSubmit").submit(); });

提交回复
热议问题