Here is a complete test case, a very simple one in fact. It consists
of a gadget with a button, and a servlet that serves the gadget's xml
and also listens to the xmlhttprequest later triggered by the button
via makeRequest(). When I click the gadget's button makeRequest is
called requesting the url http://telmex.livra.com/request/ajax. The
gadget itself resides at http://telmex.livra.com/request. The servlet
is mapped to http://telmex.livra.com/request/* so it attends both
requests. It logs each incoming request to stdout. The resulting
output, after each click, is:

/request/ajax     <-- makeRequest expected request
/request          <-- misterious additional request

Can you help me please? At least give me a clue to start debugging.
This is a severe issue with a basic feature and I don't think the
problem is at my side because I've reduced the test scenario to the
bare minimum already.

Thank you in advance
Regards
-Carlos

The servlet:


@SuppressWarnings("serial")
public class MakeRequestServlet extends HttpServlet {

        @Override
        protected void doGet(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException {
                System.out.println(req.getRequestURI());
                try {
        
IOUtils.copy(getClass().getResourceAsStream("MakeRequestGadget.xml"),
resp.getOutputStream());
                } catch (IOException e) {
                        e.printStackTrace();
                }
        }
}

The gadget:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Hello World!" description="Testing app"
author_email="[EMAIL PROTECTED]">
    <Require feature="opensocial-0.7" />
  </ModulePrefs>
  <Content type="html"><![CDATA[

<script>

  function mreq() {
    var params = {};
    params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
    var headers = {};
        headers["Wicket-Ajax"] = "true";
        params[gadgets.io.RequestParameters.HEADERS] = headers;
        params[gadgets.io.RequestParameters.REFRESH_INTERVAL] = 0;
    gadgets.io.makeRequest("http://telmex.livra.com/request/ajax";,
response, params);
  };

  function response(obj) {
  };

</script>

<input type="button" onclick="mreq()"/>

  ]]></Content>
</Module>




On Sep 2, 3:56 pm, memeplex <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> when executing the following:
>
>     var params = {};
>     params[gadgets.io.RequestParameters.CONTENT_TYPE] =
> gadgets.io.ContentType.TEXT;
>     params[gadgets.io.RequestParameters.REFRESH_INTERVAL] = 0;
>     gadgets.io.makeRequest(aUrl, response, params);
>
> the server is receiving two different requests, one for aUrl and one
> for the gadget url. Is this expected? If so, is there any way to
> differentiate between a gadget request that comes immediately after a
> makeRequest and the initial gadget request?
>
> Thank you in advance
> Best regards
> -Carlos

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" 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/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to