Hi,
I am sending the following ajax request to web application:
function open_login_win() {
Dialog.confirm($('login').innerHTML,
{className:"alphacube", width:500,
okLabel: "login", cancelLabel: "cancel",
onOk:function(win){
var user_name =
document.getElementById('username').value;
var passwd =
document.getElementById('password').value;
//make an ajax call to the authentication
service
new Ajax.Request('http://localhost:8080/
swimsenselog/authenticate',
{
method:'post',
parameters: {userName: user_name,
password: passwd},
onSuccess: function(transport){
var json =
transport.responseText.evalJSON();
var response = transport.responseText ||
"no response text";
alert("Success! \n\n" + response);
},
onFailure: function(){ alert('Something
went wrong...') }
});
I am using Struts2 to render a JSP page as a response. It has the
following code:
<%...@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:property value="jsonResponse" />
Somewhere, the json response is being encoded. The orgiginal json
response on the java console looks like: "{"authenticated":"false"}"
but by the time I see it in Firebug, it looks like this: "
{"authenticated":"false"}"
I have tried changing the contentType and it did not help. I can also
pass back hardcoded strings like ("this is a test") in the jsp and it
comes back as an unencoded string - as i would expect.
Any thoughts? Thanks in advance for any help.
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.