Hi Ludo,
Ok I won't post the bug.
Seems like an odd limitation however.
I'm not going to use the proxy, I took a look at the page but it seems kind
of overkill for what I need it to do.
AccordeonMenu takes expressions in the url as it turns out. So I pass the
parameters to a JSP as url parameters and use them in an expression in the
url for accordeoMenu. This only takes 10 lines of code, not 10 pages.
Sorry for the lazyness.
Anyway, behaviour by design obviously, so I won't post anything :)
Cheers & thanks a lot,
Wim
-----Original Message-----
From: Ludovic.Champenois_at_Sun.COM [mailto:Ludovic.Champenois_at_Sun.COM]
Sent: donderdag 1 januari 2009 4:01
To: quality_at_glassfish.dev.java.net
Subject: Re: problem with jmaki.accordionMenu widget and WEBrick
Judy Tang wrote:
> Hi Wim,
>
> Happy Holidays :-)
>
> Thank you for reporting this bug and find a work around. Would you
> help us to log a bug please ?
>
Why filing a bug on NetBeans, or jMaki, or WebRick or GlassFish or
elsewhere....?
Ajax service calls cannot be cross servers (hostname+portnumber) (read
http://ajaxpatterns.org/XMLHttpRequest_Call#Accessible_URLs )
In your case, you have 2 servers (one on 9082 and the other one on 3000)
but you can use a server side jMaki proxy. Read
https://ajax.dev.java.net/xmlhttpproxy.html )
Ludo
> http://www.netbeans.org/community/issues.html
>
> Thanks,
> Judy
> Wim Verreycken wrote:
>
>> Hi everyone,
>>
>> It seems to me this is a bug.
>> I haven't been able to find ouy WHY the jmaki accordeonMenu doesn't
>> accecpt
>> a json file generated by WEBrick.
>>
>> But I did find a workaround :
>> I created a JSP which simply imports the json page from WEBrick, and
>> passes
>> it to the jmaki accordeonMenu.
>> And there it is! Menu works!
>> Don't ask me why this is happening. I'd sure like to know. This beats
>> me.
>>
>> Here's the JSP page I wrote to forward the json to jmaki menu:
>> <%_at_page contentType="text/html"%>
>> <%_at_page pageEncoding="UTF-8"%>
>> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>> <c:catch var="ex">
>> <c:import url="http://localhost:3000/menus/menufile/1.json" />
>> </c:catch>
>> <c:if test="${ not empty sessionScope.ex }">
>> Error: <c:out value="message" />
>> </c:if>
>>
>> No much indeed, but it does the trick.
>> I would recommend however someone'd take a look at the jmaki
>> accordeonMenu
>> and find out why this is happening.
>>
>> Kind regards & Best Wishes,
>>
>> Wim
>> -----Original Message-----
>> From: Wim Verreycken [mailto:wim_at_pizzastop.be] Sent: maandag 29
>> december 2008 19:52
>> To: quality_at_glassfish.dev.java.net
>> Subject: problem with jmaki.accordionMenu widget and WEBrick
>>
>> Hi everyone,
>>
>>
>> I have a problem with the jmaki accordionMenu and WEBrick(Netbeans
>> Built-in
>> JRuby 1.1.4).
>>
>> When use the accordionMenu like this :
>> <a:widget name="jmaki.accordionMenu"
>> service="http://localhost:3000/menus/menufile/1.json"/>
>> The menu stays empty! (1.json generated by JRuby ERB template).
>>
>> Then when I go to http://localhost:3000/menus/menufile/1.json, save
>> the json
>> file with the browser, and I copy it to the jmaki webproject in
>> netbeans,
>> under "Web Pages", the result is
>> http://localhost:9082/Z4LunchlinkWeb2/1.json
>>
>> Then when I change the jmaki accordionmenu to use this url like this:
>> <a:widget name="jmaki.accordionMenu"
>> service="http://localhost:9082/Z4LunchlinkWeb2/1.json"/>
>> the menu appears fine. (!?!!!!)
>>
>> I used TCPMon to see if there where any differences in the responses
>> from
>> Glassfish and WEBrick.
>> There's only a small difference in the headers :
>> HTTP/1.1 200 OK
>> X-Powered-By: Servlet/2.5
>> Server: GlassFish/v3
>> ETag: W/"818-1230567786265"
>> Last-Modified: Mon, 29 Dec 2008 16:23:06 GMT
>> Content-Type: text/html; charset=iso-8859-1
>> Content-Length: 818
>> Date: Mon, 29 Dec 2008 18:09:01 GMT
>>
>> HTTP/1.1 200 OK Cache-Control: Connection: Keep-Alive
>> Date: Mon, 29 Dec 2008 18:09:16 GMT
>> Content-Type: text/html; charset=iso-8859-1
>> Etag: "6900bb3142390f0610fff9df909c6141"
>> Server: WEBrick/1.3.1 (Ruby/1.8.6/2007-09-24)
>> X-Runtime: 0.07800
>> Content-Length: 818
>>
>> These are the only differences. You don't even see this in a browser.
>> In Firefox the json file on both url's
>> looks EXACTLY the same. But the jmaki AccordionMenu only accepts the
>> json
>> file served by Glassfish, not the one generated by JRuby! :(
>>
>> Does anyone know why? Can anyone help me please?
>> Or where do I go with problems relating to jmaki.accordionMenu ?
>>
>> Thanks and Best wishes for the New Year to everyone!
>>
>>
>> Wim
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: quality-help_at_glassfish.dev.java.net
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: quality-help_at_glassfish.dev.java.net
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: quality-help_at_glassfish.dev.java.net
>
---------------------------------------------------------------------
To unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: quality-help_at_glassfish.dev.java.net