FacesContext redirect with POST parameters

前端 未结 1 920
梦如初夏
梦如初夏 2021-01-29 00:46

I need to redirect page into external site with POST parameters, but I cannot use vanilla HTML

like it is explained here:

JSF co

1条回答
  •  感动是毒
    2021-01-29 01:39

    Try something like this:

    JAVASCRIPT:

    function redirect() {
        document.getElementById("mySubmitButton").submit();
    }
    

    XHTML:

    
         REDIRECT
    
    
    

    EDIT: Added another test.

    PASSING DYNAMIC PARAMETER:

    In this example we assume that we are always going to send a value.

    JAVASCRIPT:

    function redirect(dynamicValue) {
        document.getElementById("dynamicField").value = dynamicValue;
        document.getElementById("mySubmitButton").submit();
    }
    

    XHTML:

    
         REDIRECT
    
    
    

    0 讨论(0)
提交回复
热议问题