3.2.0

Posting not working with AW.HTTP.Request

Hey I am unable to get the request object to post to another url. When I click on the button it does nothin.

var obj5 = new AW.UI.Button;
obj5.setId("button");
obj5.setControlText("Log On");
obj5.onClick = function()
{
var req = new AW.HTTP.Request;
req.setURL("userinfo.jsp");
req.setUsername("user");
req.setPassword("pass");
req.setRequestMethod("POST");
req.request();
};
obj5.refresh();
michael( newpublicsphere )
May 23,
Any updates on this. I am facing similar problem
Viswanath AT
Viswanath AT
August 23,
This might help:

http://www.activewidgets.com/javascript.forum.13995.9/how-can-i-send-a.html

Karl Thoroddsen
August 23,
I want to call another jsp on click of a button and I also tried XML.Table
login.onClick = function logg()
{
var req = new AW.XML.Table;
req .setURL('loginval.jsp');
req .setRequestMethod('POST');
req .setParameter('uid', uname.getControlText());
req .setParameter('pwd', pname.getControlText());
req .request();
};
This does nothing when I use with AW.XML / AW.HTTP.
Only if I add the following, the second jsp is executed but gets loaded in the first jsp itself.
req .response = function(text)
{
document.open();
document.write(this.getResponseText());
document.close();
};

1. Do we need to have <FORM METHOD=POST ACTION="loginval.jsp">
also?

2. How do we get the second jsp loaded on click of a AW.Button?

3. Is there any other way to pass parameters to another jsp, instead of appending them in URL?
Viswanath AT
August 24,
If you want to navigate to another page you should just use

window.location = newURL;

When you send a request with AW.HTTP.Request class the result is returned in response() callback, it does not change the content of the current page.
Alex (ActiveWidgets)
August 24,

This topic is archived.

See also:


Back to support forum