Skip to main content

Configuration of CombinedResourceServlet to combine JS & CSS resource calls

20 replies [Last post]
bouteill
Offline
Joined: 2004-07-02

Hello, we just upgraded to jMaki 1.8 to leverage the new CombinedResourceServlet described @ https://ajax.dev.java.net/performance.html

I made the changes below to our web.xml and I'm watching the resource calls in firebug, but I'm not see any combined calls. It's still fetching the resource.js individually for each widget.
Am I missing something?
Is there anything else to do to activate the concatenation of JS & CSS resources?
Thanks,

==== //depot/calliope/main/calliope-war/web/WEB-INF/web.xml#36
72a73,88
>
> jMakiCombineResourceServlet
> jmaki.runtime.CombinedResourceServlet
>
> jmaki-combined-resources-service
> /jmaki
>
>
> jmaki-combinescripts
> true
>
>
> jmaki-combinestyles
> true
>
>
137a153,156
>
> jMakiCombineResourceServlet
> /jmaki
>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
carlavmott
Offline
Joined: 2005-02-10

Thanks bouteill,

It would really help to see the page source that is rendered. The work of combining the code is done by the server side runtime. I'm hoping that by looking at what is generated we can get more clues. You can either send it to the dev list or me directly and I will share it with Sloan and Greg.

Thanks,
Carla

sloanb
Offline
Joined: 2003-09-14

Would you like me to send you an example application that has a copy of it working using your mapping? I was able to set it up using /jmaki as the combined resource service. Let me know and I will email it to you.

bouteill
Offline
Joined: 2004-07-02

Hi Sloan, I'm afraid it's not going to be that much help unless you identified something I configured wrong as chances are it's then likely to be some sort of incompatibility with our Java EE environment, but I'll take anything at this point. :)
Would it be much hassle to instrument the class calling the CRS with debug logs and send it to me? I can try to do it myself if you can point me to the source of the relevant class.
Thanks,

bouteill
Offline
Joined: 2004-07-02

Hi Sloan, I didn't get your sample yet. Could you please resend it to me? Thanks.

bouteill
Offline
Joined: 2004-07-02

Let me just clarify that our site pages are rendering fine.
The problem is that even though I configured the CRS and it's running, jmaki is not combining the JS and CSS calls for the different widgets on the page.

bouteill
Offline
Joined: 2004-07-02

Ok so for people out there wondering, I was pointed to a jMaki test ajax/ws/jmaki/tests/widget/web/performance/combined-jsf.jsp as an example (Thanks Greg!) and there are new jmaki tags to be used in the page to buffer the widgets (in addition to the server side settings described @ https://ajax.dev.java.net/performance.html ).
It needs to look like this:

[i]












[/i]
Ok, now the bad news is that although I do get the resources invoked inline the by (see output below), it's still not working as expected:
1) jmaki-min.js gets invoked although I have CRS jmaki-useminfied = false
2) it's not combining the calls into one although I have CRS jmaki-combinescripts = true
3) it's adding the widgets automatically in the header while we used to have them at the bottom - is there any way to prevent or delay that?
4) the localhost is no good in a production environment - is there a place to configure the servername or make them relative URLs?
It's like it's not registering the CombinedResourceServlet init-params in my web.xml? Thoughts?
Is there another config to instruct the client to combine scripts?

[i]

[i]

PS: fixed link typo

Message was edited by: bouteill

bouteill
Offline
Joined: 2004-07-02

Ah, so FYI for people with the same issue, my problem with (2) and resources not combining was that the properties of CombinedResourceServlet documented @ https://ajax.dev.java.net/performance.html are not Servlet parameters (web-app/servlet/init-param) but Web Application Context Parameters (web-app/[u]context-param[/u]). Confusing. See test example @
https://ajax.dev.java.net/source/browse/*checkout*/ajax/ws/jmaki/tests/w...

I'll open new threads for the other questions since they're somewhat off topic and this thread is getting long.
Thanks to all who helped.

bouteill
Offline
Joined: 2004-07-02

Another question just to make sure: We're not using jMaki's XmlHttpProxy and the Servlet is not deployed in our environment. Can you please confirm the CRS doesn't rely on that to work properly?
Thanks.

gmurray71
Offline
Joined: 2003-07-31

The combined resource servlet does not depend on the XmlHttpProxy / XmlHttpProxyServlet.

bouteill
Offline
Joined: 2004-07-02

Following up on Carla's request, here's the jmaki.debug log output I get:

Publish : Topic: /jmaki/runtime/intialized message {}
Publish : Topic: /jmaki/runtime/extensionsLoaded message {}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:issueCoverFB:loginStatus'}... [more]
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:issueCoverFB:loginStatus'}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:collaborationModule'}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:itemsManager'}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:researchItems'}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:destinationAC'}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:scheduleItems'}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:loginContent'}
Publish : Topic: /jmaki/runtime/widget/loaded message {id : 'tripFB:researchMap'}
Publish : Topic: /jmaki/runtime/widgetsLoaded message {}
Publish : Topic: /jmaki/runtime/loadComplete message {}

bouteill
Offline
Joined: 2004-07-02

So if I invoke /jmaki?something on my server it seems to hit the Servlet fine (I see CRS messages in the logs).
Seems like it's the client js code which doesn't think of calling it...
Is there anything we need to do in the pages to tell jmaki to leverage the CRS?

sloanb
Offline
Joined: 2003-09-14

Bouteill,

From what you are telling me it appears that the combined resource servlet is working however the pages are not rendering. To test this is there a way you can post a page that has been rendered. What we are looking for is something like this:

[code]