struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: why Struts2 can't receive Jsp variable value by using Ajax1.2?
Date Sat, 10 Feb 2007 12:49:07 GMT
--- red phoenix <rodphoenix@gmail.com> wrote:
> [... taking the long road to Ajax, hey? ...]
> function test(){
>  var t1=document.forms[0].abc.value;
>  alert(t1);
>  var url = "add.action";
>  http.open("POST",url,false);
>  http.onreadystatechange = handleHttpResponse;
>  http.send(null);
> }

I'll admit I've never bothered doing Ajax quite this
manually before, but you're not submitting the form,
but doesn't this just make a post request to the URL?

Try something like:

  var url = "add.action?abc=" + t1;
  http.open("GET",url,false);

I would, however, *strongly* urge you to use any
number of *way*-easier ways to do Ajax, especially
considering that S2 ships w/ lots of Ajax support.

> Why struts2 can't get jsp page value by using ajax?

I think you have misrepresented the problem somewhat.

d.



 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message