Quick-n-Dirty: Control Dojo generation for individual XPages

Another interesting question has been asked on stackoverflow.com: How to enable or disable the Dojo libraries for individual XPages, not the whole application?

Just adding the parameter as shown below to the XPage won’t work:

 <xp:parameter name="xsp.client.script.libraries" value="none" />

The workaround is to add a single line to beforePageLoad or beforeRenderResponse event:


The parameter can be set as the following

  • „0“ disables Dojo Framework
  • „1“ enables Dojo Framwork
  • „2“ enables Dojo Lite Framework

If you are using the ExtLib, there is still a problem with the automatically added CSJS libraries. These headers will be added automatically (it is the same result if you are disabling dojo application wide):

<script type="text/javascript">dojo.registerModulePath('extlib', '/xsp/.ibmxspres/.extlib');</script>
<script type="text/javascript" src="/xsp/.ibmxspres/.mini/dojo/@Eya.js"></script>


This can only be removed by disabling the ressource aggregation or disabling the Extension Library for the whole application.

You can disable it f.e. by adding this to your XPage beforeRenderResponse event:

   .setProperty("xsp.resources.aggregate", "false")
Dieser Beitrag wurde unter ExtLib, Server, ServerSide JavaScript, XPages abgelegt und mit , , , , , , , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

1 Antwort zu Quick-n-Dirty: Control Dojo generation for individual XPages

  1. Mark Leusink sagt:

    Interesting. Didn’t know/ realize that the facesContext object is an instance of the com.ibm.xsp.domino.context.DominoFacesContext class. I always assumed it was of javax.faces.context.FacesContext. That class has a whole lot of other interesting functions too!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.