This plugin aggregates all DWR interface scripts into single JS resource including engine.js and dtoall.js to reduce amount of http requests.
Supported DWR version: plugin supports DWR 3.0 RC2. It wasn't tested with DWR 3.0 RC3 since it's in development stage.
In command line perform:
-
git clone [email protected]:oraz/dwr-aggregation.git
-
mvn install
Or download zip archive with sources, unzip it and run mvn install.
<dependency>
<groupId>dwr-aggregation</groupId>
<artifactId>dwr-aggregation</artifactId>
<version>1.0</version>
</dependency><servlet>
<!-- DWR servlet definition here -->
<init-param>
<param-name>url:/dwr-aggregated.js</param-name>
<param-value>org.dwr.aggregation.impl.DwrAggregationHandler</param-value>
</init-param>
<init-param>
<param-name>org.directwebremoting.extend.CreatorManager</param-name>
<param-value>org.dwr.aggregation.impl.DebugModeIgnoredCreatorManager</param-value>
</init-param>
</servlet>If you configured DWR to map Java classes to JavaScript classes you should add one more param to reduce size of aggregated script.
<servlet>
<!-- DWR servlet definition here -->
<init-param>
<param-name>generateDtoClasses</param-name>
<param-value>dtoall</param-value>
</init-param>
</servlet>Was:
<script src="/dwr/engine.je"></script>
<script src="/dwr/dtoall.je"></script>
<script src="/dwr/interface/userManager.je"></script>
<script src="/dwr/interface/cityManager.je"></script>Now:
<script src="/dwr/dwr-aggregated.je"></script>