lundi 18 mai 2015

How can I obtain the value of the a input tag from the class that implement the HttpServlet and that handle the request of the submitted form?

I have the following situation.

Into a JSP page I have a form, something like this:

<form name="inboxform" action="edi.do?serv=Q.2" method=post onsubmit="javascript:return checkAutorizza()">
    <input type="hidden" name="autorizza" value="" id="aut">
    <input type="hidden" name="notaRifiuto" value="" id="notaRifiuto">
    <input type="hidden" id="pkcodaSelected">

    ........................................................
    ........................................................
    ........................................................
</form>

So, as you can see in the previous code snippet, there are 3 hidden input tag (their content is setted by a JavaScript)

and then I have this JavaScript function:

function checkRifiuta() {
    alert("INTO checkRifiuta()");
    if (isCheckboxChecked2('item') == false) {
        alert('Nessun documento selezionato da autorizzare');
        return false;
    } else {
        document.getElementById('aut').value = "false";

        document.forms.inboxform.action = "edimon.do?serv=O.E";
        alert("action: " + document.forms.inboxform.action.valueOf());
        document.forms.inboxform.submit();
        alert("AFTER FORM SUBMIT")
        return true;
    }
}

that mainly do the following 2 operations (the thing that interest me at this time):

  1. Change the action value of the form, by:

    document.forms.inboxform.action = "edimon.do?serv=O.E";
    
    
  2. Submit the form, by:

    document.forms.inboxform.submit();
    
    

So it means that the previous form is submitted toward the URL: edimon.do?serv=O.E

In the class that implement the HttpServlet I handle request toward the previous URL.

My problem is: how can I extract the values of the previous hidden input tag of this submitted form from my backend? (from the class that implement the HttpServlet and that handle request toward the edimon.do?serv=O.E URL)

Tnx

Aucun commentaire:

Enregistrer un commentaire