Extension ID
com.castsoftware.dwr
What's new?
Please see Direct Web Remoting - 1.0 - Release Notes for more information.
Description
This extension provides support for Direct Web Remoting - an open source, component oriented, Java library, that enables Java on the server and JavaScript in a browser to interact and call each other as simply as possible. DWR is Easy Ajax for Java.
In what situation should you install this extension?
The main purpose of this extension is to improve the transaction path between JavaScript (.js, .jsp or .html) files that contain calls to methods declared on the Java server-side. The analysis of Direct Web Remoting therefore also requires that the HTML5 and JavaScript and the JEE Analyzer are installed.
2018-07-04 20:27:29,227 INFO SecurityAnalyzer.Processor LoadBlackboxesForApplication cast#spec cast#lib DWRServiceEntryPoints
com.castsoftware.dwr: ≥ 1.0.2-funcrel <BytecodeFolder>\com.castsoftware.dwr\ServiceEntryPoints.blackbox-v2.xml com.castsoftware.dwr: all releases <BytecodeFolder>\com.castsoftware.dwr\ServiceEntryPoints.blackbox.xml
- The ServiceEntryPoints.blackbox-v2.xml file will only be exploited by the
- The ServiceEntryPoints.blackbox.xml file will only be exploited by the
- Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
- Quality and Sizing: a green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist
Function Points | Quality and Sizing |
---|---|
AIP Core release | Supported |
---|---|
8.3.x |
Supported DBMS servers
DBMS | Supported? |
---|---|
CAST Storage Service / PostgreSQL |
Prerequisites
An installation of any compatible release of AIP Core (see table above) |
Download and installation instructions
The extension will not be automatically downloaded and installed in CAST Console. If you need to use it, you should manually install the extension using the Application - Extensions interface:
When installed, follow the instructions below to run a new analysis/snapshot to generate new results:
- Application onboarding with Fast Scan - run the initial deep analysis
- Application onboarding without Fast Scan - Step-by-step onboarding - Run the analysis
What results can you expect?
Objects
The following objects are identified:
Icon | Description |
---|---|
Call to a DWR service method | |
A DWR service method |
Support of interaction between frontend and backend via dwr.xml binding
Take the following example where a .JSP file contains the function deleteIndex and the functionCall CMSMaintenanceAjax.deleteIndex:
with the associated dwr.XML file (only a snippet of it):
This allows the creation of a new object DWR CallTo Method as well as the callLink on the client side between the JavaScript functionCall and the DWR CallTo Method. In addition, below is a Java file containing the class com.dotmarketing.portlets.cmsmaintenance.ajax.CMSMaintenanceAjax and the method deleteIndex:
This allows the creation of the new object DWR Method as well as the callLink on the server side between the DWR Method object and the Java method declaration. Finally, the link between the DWR CallTo Method and DWR Method is created via the extension com.castsoftware.wbslinker using name matching.
Here are some example results:
Click to enlarge
For this result, the following Objects, Links and Properties are added:
Objects
Icon | Type of Object | Name of Object | Primary Bookmark |
---|---|---|---|
DWR CallTo Method | CMSMaintenanceAjax.deleteIndex | on function call | |
DWR Method | CMSMaintenanceAjax.deleteIndex | On create block in dwr.xml file if method is "include" then bookmark on include block instead |
Links
Extension responsible | Caller | Caller name | Type of Link | Callee | Callee name |
---|---|---|---|---|---|
com.castsoftware.dwr | HTML5 JavaScript function | deleteIndex | callLink | DWR CallTo Method | CMSMaintenanceAjax.deleteIndex |
com.castsoftware.dwr | DWR Method | CMSMaintenanceAjax.deleteIndex | callLink | JAVA Method | deleteIndex |
com.castsoftware.wbslinker | DWR CallTo Method | CMSMaintenanceAjax.deleteIndex | callLink | DWR Method | CMSMaintenanceAjax.deleteIndex |
Properties
None
Support of interaction between frontend and backend via complex xml binding
Take the following example where the index.html file contains the function getDataFromServer and the functionCall dwrService.getAddress:
The following xml file which is mentioned within the web.xml:
and the java file containing the dwrService.getAddress method declaration:
Here are some example results:
Click to enlarge
For this result, the following Objects, Links and Properties are added:
Objects
Icon | Type of Object | Name of Object | Primary Bookmark | Parent |
---|---|---|---|---|
DWR CallTo Method | dwrService.getAddress | on function call | Function containing the function call | |
DWR CallTo Method | dwrService.getAddress | on function call | Function containing the function call | |
DWR Method | dwrService.getAddress | On create bean block in secondary xml file. if method is "include" then bookmark on include block instead | the secondary xml file |
Links
Extension responsible | Caller | Caller name | Type of Link | Callee | Callee name | Remarks |
---|---|---|---|---|---|---|
com.castsoftware.dwr | HTML5 JavaScript function | getDataFromServer | callLink | DWR CallTo Method | dwrService.getAddress | Based on parent |
com.castsoftware.dwr | HTML5 JavaScript function | getDataFromServer | callLink | DWR CallTo Method | dwrService.getAddress | Based on parent |
com.castsoftware.dwr | DWR Method | dwrService.getAddress | callLink | JAVA Method | getAddress | |
com.castsoftware.wbslinker | DWR CallTo Method | dwrService.getAddress | callLink | DWR Method | dwrService.getAddress |
Properties
None
Support of interaction between frontend and backend via Annotations
Take the following Annotations on the backend java file named : ArithmeticService.java.
And the first associated file named ajax-add-page.jsp:
Here are some example results:
Click to enlarge
For this result, the following Objects, Links and Properties are added:
Objects
Icon | Type of Object | Name of Object | Bookmark |
---|---|---|---|
DWR CallTo Method | dwrService.add | On function call | |
DWR Method | dwrService.add | On Annotated Method |
Links
Extension responsible | Caller | Caller name | Type of Link | Callee | Callee name |
---|---|---|---|---|---|
com.castsoftware.dwr | HTML5 JavaScript function | add | callLink | DWR CallTo Method | dwrService.add |
com.castsoftware.dwr | DWR Method | dwrService.add | callLink | JAVA class | add |
com.castsoftware.wbslinker | DWR CallTo Method | dwrService.add | callLink | DWR Method | dwrService.add |
Properties
None
Within DWR framework, when using Annotations:
- For a method to be exposed the RemoteMethod and the RemoteProxy (on the class) must be present.
- For finding dwr function call in *.js file in absence of xml configuration (i.e. from Annotation), the javascript alias is looked upon nearby header script in other *.jsp or *.html.
General Case on Frontend within DWR framework:
- When two identical function call within the same function occurs only one DWR CallTo Method object is created. However, there is multiple bookmark for each function call within the method.
- DWR CallTo Method can be found in *.js, *.jsp and *.html files.