When you do a post you need to open the connection like so
server.open("POST",URL,false) where server is your xhr object.
To send as a post you need to encode your name value pairs to be sent and pass
them as the body of the request.
server.send(name=value&pairs=go&here=true);  then they will show up on the
server as parameters instead of attributes.


Bryan LaPlante

---------- Original Message -----------
From: "vijay r" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Tue, 11 Apr 2006 13:30:47 +0530
Subject: Re: {Maybe OT} Ajax with struts

> Yes, that was the problem.
> 
> I changed the POST parameter to GET in http.open(); and its working. Keeping
> it POST and passing the parameters in send() does not work.
> 
> Anyways, making it GET works and thats what I need. But what could be the
> problem?
> 
> regards,
> vijay.
> 
> On 4/11/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> >
> > On 4/10/06, vijay r <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I used AJAX to fill details for a corrosponding selected value listed in
> > a
> > > combo box. So for a particular registration number, the details of the
> > > vehicle are filled.
> > >
> > > On the onchange() event of the combo box, I am calling a JavaScript
> > function
> > > which creates a XmlHttpRequest with the url = "RegDetails.do
> > ?action=populate"
> > > where action is a DispatchAction parameter. I am working in Websphere
> > > Application Developer Studio and its working great in it. But when I
> > deploy
> > > the application in Websphere AS 5.0, the AJAX stuff does not work.
> > >
> > > Pre-population of the jsp form works great (which is also based on
> > > DispatchAction - I give
> > > http://localhost:9080/dpims/RegDetails.do?action=populate). Only the
> > AJAX
> > > stuff does not work. I get the following error
> > >
> > > [4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
> > > org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
> > > contain handler parameter named action
> > >
> > > I am not able to figure out the problem.
> >
> > If you use POST for your XHR, you must specify request parameters in
> > XHR.send(...) instead of appending them to action address. If you use
> > GET, well, your URL seems ok, I would pass null in XHR.send(...) but I
> > am not sure that this is the problem.
> >
> > Michael.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
------- End of Original Message -------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to