Our JBoss form is posting the parameters in the URL instead of in the request despite being a POST form. I have confirmed that the form is post in the actual page using Firebug. Note that this is within a portlet.
We are submitting the form using javascript like:
function submitForm(action, time)
{
document.getElementById("pageActionInputID").value = time;
document.getElementById("timeSpanFormInputID").value = action;
document.getElementById("formID").submit();
}
<form action="<portlet:actionURL></portlet:actionURL>" method="POST" id="formID">
<input type="hidden" name="pageAction" id="pageActionInputID" />
<input type="hidden" name="timeSpan" id="timeSpanFormInputID" />
</form>
where 'portlet' is from
<%# taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
Any ideas why we are getting the inputs in the URL?
Here is what the resulting markup looks like:
<form id="formID" method="post" action="/portal/auth/portal/myTab?action=1">
<input id="pageActionInputID" type="hidden" name="pageAction"/>
<input id="timeSpanFormInputID" type="hidden" name="timeSpan"/>
</form>
Though it would be great if someone could confirm it. I think the JBoss Portlet throws out post/get and uses action URLs instead.
A descriptive article about render and action URLs
Related
Consider this form:
<form method="GET" action="/signup?foo=1">
<input type="hidden" name="bar" value="2"/>
<input type="submit"/>
</form>
Will browsers reliably request "/signup?foo=1&bar=2"?
No.
JS Fiddle suggests Chrome will discard foo=1, and request /signup?bar=2.
I'm using ASP.NET web forms and i need to post data to an iframe, the problem is that in web forms I have the main form tag(form1), so i need another form tag(form2), to post data to the iframe that is in the main form1.
Basically i have this:
<form method="post" id="form2" action="http://localhost:58903/WebForm1.aspx" target="webApp">
<input type="hidden" name="ValidationUserName" value="david" />
<input type="hidden" name="ValidationTokenId" value="13123132132" />
<button type="submit">Send info to inner iframe</button>
</form>
<form id="form1" runat="server">
<iframe id="webApp" name="webApp" src="http://localhost:58903/WebForm1.aspx" style="width: 800px; height: 800px;"></iframe>
</form>
With this approach in open a new tab, if i put the iframe outside it works ok, but if i do this the layout is changed and i don't want this.
Is this possible?
If all the forms are in the same domain you should not work with iframes.
What exactly are you trying to get here? didn't realize completely
Done it, it was missing the "name" attribute in the <form> tags.
i first tried to make request to server with GET method and it works fine. my request would process a file then return as a pdf file and would open on a new browser. what i did is overriding the doGet() method. since having a GET request is only limited to few parameters, i must change it to doPost() mehod but the problem is that it can't be overrided because the method is final.
in an HTML FORM, what i wanted to happen is something like this:
<form method="post" action="http://differentdomain.com/appserv/appserv.php">
<input type="hidden" name="fwi_script" value="app/custom/cusapp/interface" />
<input type="hidden" name="trx" value="<trx>
<productid>PROD1</productid>
....../** transaction details here */
</trx>" />
<input type="hidden" name="fcompanyid" value="SHOST101" />
<input type="hidden" name="fwi_action" value="PRINT_PENDING_SALES" />
<input type="hidden" name="fexcel" value="0" />
<input type="submit" value="Submit" />
</form>
this html form will print the order slip of every transaction when user clicks on the post order button.
anyone can give an idea on how to POST request in GWT server? i think i can't do it with RequestBuilder since i will be having the SOP problem since i will be connecting to a different domain.
To build very nearly the same html you have in your question, start with a FormPanel and add the form fields you need to it. Make sure to configure the FormPanel with the correct action and method, and to provide names (and possibly values) to the fields added to it. To fire off the request, submit() can be called.
The solution is to make a normal GWT RPC call to your server and have the server make the POST request to the server located on a different domain.
In my webapplication, a JSP page outputs to the webpage, the list of users logged in that day. I want to mail the same output to specifics mail-ids. What all Struts2 tags do I need to use?
Grab the HTML using JavaScript and send it as request parameter.
<div id="content">
... (here you should put content which you'd like to mail)
</div>
<form action="mail" method="post" onsubmit="html.value = encodeURIComponent(document.getElementById('content').innerHTML)">
<input type="hidden" name="html" />
<input type="submit" value="Mail this document" />
</form>
It'll be available as request parameter with name "html" in Struts2/Servlet side. The emailing job can be done with help of JavaMail.
I have a login form written in PHP and each time I start the browser and go to the respective page, the first field of the form is this:
<input type="hidden" name="PHPSESSID" value="session_id_code" />
If I close the window, but I don't restart the browser, this doesn't happen. Any idea what's happening and why?
Thanks!
Form's code:
<?php
if (condition) {
?>
<form method="post" action="">
<dl>
<dt>Email:</dt>
<dd><input type="text" name="useremail" /></dd>
<dt>Password:</dt>
<dd>
<input type="password" name="userpass" /></dd>
<dt class="dt-buttons"><input type="submit" name="button_login" value="Login" class="button" /></dt>
</dl>
<input type="hidden" name="formkey" id="formkey" value="224ca00155w2fcda8906e1e40af03a71" />
</form>
<?php
}
?>
The form is simple HTML and is not dynamically generated.
EDIT2:
As I was saying, when I access the page for the first time after I started the browser, this thing happens. If I refresh the page afterwards, the hidden field doesn't show up.
Is it possible to have something to do with the SSL certificate? And if yes, why some pages/forms behave like this and some don't?
Sounds like you've got trans_sid enabled (transparent session id). Using trans_sid can be a security issue, especially if your site links to external content, or you allow link sharing - it lets a user's session ID leak out as part of the URL, meaning the session is highly vulnerable to hijacking.