yes it is important to set the Wicket-Ajax header. this is how wicket
knows the request is a wicket ajax request as opposed to a normal
request.

-igor

On Jan 9, 2008 4:17 AM, Peter Thomas <[EMAIL PROTECTED]> wrote:
> On 1/8/08, Peter Thomas <[EMAIL PROTECTED]> wrote:
> >
> > On 1/8/08, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> > >
> > > The random parameter is to prevent the browser from caching the
> > > requests. It
> > > shouldn't have any implication afaict.
> > > Martijn
> >
> >
> > Thanks Martijn - that answers one big question that I had in the context
> > of Ajax / JMeter.  Thanks cbergstrom for the links as well.
> >
> > I got it working now, the problem was that I had messed up the
> > AbstractFormValidator for the form :)  Something to do with
> > getDependentFormComponents() and component.getInput() vs
> > getConvertedInput() etc.
> >
> > Anyway now I have a JMeter script that includes a solitary Ajax call that
> > works now.  It looks like it should be possible to examine the XML returned
> > and do fancy conditional stuff in subsequent steps, but I don't need this
> > now, maybe later.
> >
>
> Turns out I was not quite there yet.  After a lot of frustration, I finally
> realized that Wicket looks for an HTTP Header of name "wicket-ajax" and with
> value "true"  I was building a JMeter script from scratch and found this out
> only after comparing with a recorded test.
>
> Would appreciate if someone can confirm the importance of this "wicket-ajax"
> HTTPHeader !
>
> I also observed that when an ajax request is sent without the "wicket-ajax"
> header, wicket silently accepts it and returns XML - but the response
> contents are as if the page is a fresh page.  I have a script working for
> the wicket-examples ajax Todolist (no I was not experimenting on the
> wicket-stuff site :) and at the end when I reload the page at
> "/mycontext/?wicket:interface=:0::::::" I can now verify that all the data
> appears.
>
> Curious to know where the Ajax requests without the "wicket-ajax" header are
> going.  Is it possible to throw an error or are these potentially valid
> (non-ajax) requests?
>
>
> Thanks,
> >
> > Peter.
> >
> >
> > On Jan 8, 2008 2:40 PM, Peter Thomas < [EMAIL PROTECTED]> wrote:
> > >
> > > > Hi,
> > > >
> > > > I'm trying to use JMeter when Ajax is involved.  I have a form where a
> > > > drop-down-choice "onChange" event, adds another drop-down onto the
> > > form
> > > > over
> > > > ajax.  When the form is first shown, the second drop-down component is
> > > not
> > > > visible at all.  After the ajax operation and when both the drop-downs
> > > are
> > > > visible, I submit the form normally.
> > > >
> > > > I tried to make this flow into a JMeter script.  I am using the JMeter
> > > > regex
> > > > support and am able to scrape the ajax post url.  I verified that the
> > > ajax
> > > > call successfully returns the XML response along with the expected
> > > HTML
> > > > chunk without any problems by using a response debug listener in
> > > JMeter.
> > > > Only thing I could be missing is that "&random=0.5855686047921232"
> > > kind of
> > > > thing at the end of the URL.
> > > >
> > > > The problem is this form has validation involving the second drop down
> > > and
> > > > when runing the JMeter script, the form validation always fails on
> > > submit.
> > > > It appears that even when JMeter has the drop-down value in the POST,
> > > > Wicket
> > > > doesn't see it I'm guessing maybe because the previous Ajax operation
> > > did
> > > > not work and Wicket thinks the second drop down is not visible yet.
> > > >
> > > > I seem to have everything right except the "random" thing.  So my
> > > question
> > > > is - is it possible to use something like JMeter when Ajax is involved
> > > and
> > > > has anyone had any success with something like this?  Does Wicket
> > > require
> > > > the "random" param in the Ajax request / url ?  If this random param
> > > is
> > > > indeed required what is the best way to derive the value expected.  If
> > > it
> > > > is
> > > > some wicket-ajax javascript function, it may be possible to get it
> > > > evaluated
> > > > by JMeter (rhino?) but it sounds like a very, very long shot :|
> > > >
> > > > Any suggestions or ideas would be greatly appreciated.
> > > >
> > > > Thanks,
> > > >
> > > > Peter.
> > > >
> > >
> > >
> > >
> > > --
> > > Buy Wicket in Action: http://manning.com/dashorst
> > > Apache Wicket 1.3.0 is released
> > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
> > >
> >
> >
>

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

Reply via email to