- (Classic) ASP support
- ASP.NET MVC Razor support
- JavaScript support
- Support for Web Service calls in JavaScript code
- Support for Web Service calls in html/jsp code
- Support for Web Service calls in Razor code (cshtml)
- Support for Marionette with Backbone framework
- Support for Apache Tiles framework
- Support for handlebars file
- External libraries
- Support for contents of "node_modules" folder
- End of comment and File skipped messages for .js files
(Classic) ASP support
See ASP - Technical notes and limitations.
ASP.NET MVC Razor support
See .NET - ASP.NET MVC Razor support.
JavaScript support
JavaScript (1 to 1.8.1)
- JavaScript call(), function(), bind(), prototype and prototype inheritance are supported
- Creates Functions, Classes and Constructors
- Local call links between function calls and functions inside each JavaScript file are created
JavaScript ECMA 6
Supported Object Oriented statements are as follows:
- arrows (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)
- classes (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)
- const (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)
- let (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let)
- try...catch (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch)
- subclassable built-ins
No explicit support:
- symbols (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
- promises (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise#Advanced_Example)
- reflect api (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect)
- proxies (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
Support for Web Service calls in JavaScript code
The following libraries are supported for Web Service HTTP calls:
- XMLHttpRequest
- window.open
- document.submit
- location.href
- Ext.Updater (Sencha)
- EventSource
- fetch
- axios
- superagent
- aws-amplify
- falcor
- WLResourceRequest
- WebSocket
Once the HTML5 extension analysis is finished, the analyzer will output the final number of web service calls created. When urls cannot be correctly evaluated, a HTTP call named "{}" will be created, except for:
- window.open
- window.location.href,
- document.location.href
These exceptions are due to very large number of statements, and they are not explicit calls as "ajax", "get", "post", "delete"... functions.
XMLHttpRequest
var xhttp = new XMLHttpRequest(); xhttp.open("GET", "ajax_info.txt", false); xhttp.send();
window.open
url = "EditStandaloneWeb.do?url_name_id="+urlNameId; popUpWindow = window.open(url,'popUpWindow','height=900,width=900,left=300,top=50,resizable=no,directories=no,status=no');
document.submit
addUpload.document.forms[1].action = "ciedit"; addUpload.document.forms[1].submit();
$("form[id='configurarClassificacaoProdutoForm']").action = '<s:url action="configurarClassificacaoProduto" method="excluir"/>'; $("form[id='configurarClassificacaoProdutoForm']").submit();
$form.prop('method', 'post'); $form.prop('action', '<c:out value="/toto" />'); $form.submit();
location.href
url = "//localization.att.com/loc/controller"; window.location.href = url;
url = "//localization.att.com/loc/controller"; document.location.href=url;
Ext.Updater (Sencha)
Ext.get(panelId).getUpdater().update({ url:'actionUrl', params:params, method:'POST', failure: function(inResp) {} });
EventSource
const eventsUrl = '/api/dashboard/events?token=' + localStorage.getItem('dashboard_token'); const serverEvents = new EventSource(eventsUrl);
fetch
fetch('/users', { method: 'POST', body: new FormData(form) });
axios
axios.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });
var http = require('axios'); http.get('/user', { params: { ID: 12345 } }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });
axios.request({ url : '/user', method : 'delete' });
axios('/user/12345');
axios({ method: 'post', url: '/user/12345', data: { firstName: 'Fred', lastName: 'Flintstone' } });
var instance = axios.create({ baseURL: 'https://api.example.com' }); instance.get('/longRequest', { timeout: 5000 });
superagent
request .post('/api/pet') .send({ name: 'Manny', species: 'cat' }) .set('X-API-Key', 'foobar') .set('Accept', 'application/json') .end(function(err, res){ // Calling the end function will send the request });
var myrequest = require('superagent'); myrequest .get('/some-url') .use(prefix) // Prefixes *only* this request .use(nocache) // Prevents caching of *only* this request .end(function(err, res){ // Do something });
request .head('/users') .query({ email: 'joe@smith.com' }) .end(function(err, res){ });
request('GET', '/users') .end(function(err, res){ });
request('/search', (err, res) => { });
aws-amplify
import {API} from 'aws-amplify'; API.get('ReactSample','/items/orders/' + sessionStorage.getItem('latestOrder')).then(response => {});
falcor
var falcor = require('falcor'); var model = new falcor.Model({source: new falcor.HttpDataSource('/model.json')}); model .get(["events", "byName", ["Midwest JS"], ['description']]) .then(function(response) { document.getElementById('event-data').innerHTML = JSON.stringify(response, null, 2); }, function(err) { console.log(err); });
WLResourceRequest
var request = new WLResourceRequest('/adapters/sampleAdapter/multiplyNumbers', WLResourceRequest.GET); request.setQueryParameter('params', [5, 6]); request.send().then( function(response) { // success flow, the result can be found in response.responseJSON }, function(error) { // failure flow // the error code and description can be found in error.errorCode and error.errorMsg fields respectively } );
adapterPath = new URI("/adapters/sampleAdapter/multiplyNumbers"); var request = new WLResourceRequest(adapterPath, WLResourceRequest.GET); request.setQueryParameter('params', [5, 6]); request.send().then(function(response) {}, function(error) {});
var request = new WLResourceRequest(URI("/adapters/sampleAdapter/multiplyNumbers"), WLResourceRequest.GET); request.setQueryParameter('params', [5, 6]); request.send().then(function(response) {}, function(error) {});
dojo
var xhrArgs = { url: "dojo/LICENSE_NOT_THERE", handleAs: "text", preventCache: true, handle: function(error, ioargs){ } } var deferred = dojo.xhr("POST", xhrArgs);
var xhrArgs = { url: "dojo/LICENSE_NOT_THERE", handleAs: "text", preventCache: true, handle: function(error, ioargs){ } } var deferred = dojo.xhrGet(xhrArgs); // or dojo.xhrPost, dojo.xhrPut, dojo.xhrDelete
require(["dojo/request"], function(request){ request("my_url").then( function(text){ }, function(error){ } ); });
require(["dojo/request/node"], function(nodeRequest){ nodeRequest("my_url").then( function(text){ console.log("The file's content is: " + text); }, function(error){ console.log("An error occurred: " + error); } ); });
require(["dojo/request"], function(request){ request.get("my_url").then( function(text){ console.log("The file's content is: " + text); }, function(error){ console.log("An error occurred: " + error); } ); }); // or request.post, request.put, request.del
WebSocket
var socket = new WebSocket('ws://game.example.com:12010/updates2');
Support for Web Service calls in html/jsp code
The following libraries are supported for Web Service HTTP calls:
- href
- iframe.src
- form.action
- input.formaction
- datamap
- jsp.forward
- jsp.pager
- struts-html
- struts tags-html
- struts-tags
- struts-nested
- struts jqgrid
- euamtags
- spring
Once the HTML5 extension analysis is finished, the analyzer will output the final number of web service calls created.
href
<a href="@Url.Action("Edit", "MissionMandatoryDocuments", new { type = item.Key, nodeId = Model.NodeId })"> </a>
iframe.src
<iframe src="/greco/ValidationADP.do?hidden=doPerform" height="900" width="1000"></iframe>
form.action
<form action="@Url.Action("Export", "InterimBillsEvaluation")" method="post"> </form>
<form action="<c:out value="${epayCustomer.absoluteBaseWithContextPath}"/>/dlife/payBill.perform" method="GET"> </form>
input.formaction
<input type="submit" value="Save" name="Edit" formaction="@Url.Action("edit")" class="btn btn-default" />
datamap
<div id="map" data-request-url="@Url.Action("GetStops", "Home")" data-request-url2="@Url.Action("Driving", "Home")"> <script> function getStops() { var url = $('#map').data('request-url'); window.open(url) } </script>
jsp.forward
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <jsp:forward page="/dispatcher/mainMenu"/>
jsp.pager
<%@ taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%> <html> <pg:pager url="RolePaginationAction.do" items="<%= total_records %>" index="<%= index %>" maxPageItems="<%= maxPageItems %>" maxIndexPages="<%= maxIndexPages %>" isOffset="<%= true %>" export="offset,currentPageNumber=pageNumber" scope="request"> </pg:pager> </html>
struts-html
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <html:html xhtml="true"> <div align="center"> <html:form action="/submitCustomerForm" method="GET" /> </div> </html:html>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <html:html xhtml="true"> <div align="center"> <html:link page="/submitCustomerForm" /> </div> </html:html>
struts tags-html
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%> <html:html xhtml="true"> <div align="center"> <html:link action="bookEdit.do?do=borrowBook" paramName="book" paramProperty="id" paramId="id">Borrow book</html:link> </div> </html:html>
struts-tags
<%@taglib prefix="s" uri="/struts-tags"%> <html> <s:url action="banque" method="consulter" var="urlAcceuil"/> <s:a href="%{urlAcceuil}">Retour à l'acceuil</s:a> </html>
<%@taglib prefix="s" uri="/struts-tags"%> <html> <body> <s:a action="compte" /> </body> </html>
<%@taglib prefix="s" uri="/struts-tags"%> <html> <body> <s:form action="compte"> <s:hidden name="contract_nbr" id="contract_nbr" value="%{mod.contract_nbr}"/> </s:form> </body> </html>
struts-nested
<%@ taglib uri="/tags/struts-nested" prefix="nested" %> <html:html xhtml="true"> <div align="center"> <nested:form action="modifyAccount.do" /> </div> </html:html>
struts jqgrid
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> <html> <sjg:grid id="sjgrid" dataType="json" href="/url" caption="Grid Model" gridModel="gridModel" pager="true" navigator="true"> </sjg:grid> </html>
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> <html> <sjg:grid id="sjgrid" dataType="json" editurl="/url" caption="Grid Model" gridModel="gridModel" pager="true" navigator="true"> </sjg:grid> </html>
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> <html> <sjg:grid id="sjgrid" dataType="json" cellurl="/url" caption="Grid Model" gridModel="gridModel" pager="true" navigator="true"> </sjg:grid> </html>
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> <html> <sjg:gridColumn id="sjgrid" surl="/url"> </sjg:gridColumn> </html>
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> <html> <sjg:gridColumn id="sjgrid" editoptions="{dataUrl: '/url'}"> </sjg:gridColumn> </html>
euamtags
<%@ taglib uri="WEB-INF/euamtags.tld" prefix="Euam" %> <div align="center"> <Euam:form action="/submitCustomerForm" /> </div>
spring
<%@taglib uri = "http://www.springframework.org/tags/form" prefix = "form"%> <html> <div align="center"> <form:form method="POST" action="/HelloWeb/addStudent" /> </div> </html>
<%@taglib uri = "http://www.springframework.org/tags/form" prefix = "form"%> <html> <div align="center"> <form:form method="POST" commandName="changePassword" action="" /> </div> </html>
Support for Web Service calls in Razor code (cshtml)
- Html.BeginForm
- Ajax.BeginForm
- Html.Action
- Html.ActionLinkWithAccess
- Html.ActionLink
- Ajax.ActionLink
- Html.RenderAction
- Url.Action
- Url.RouteUrl
- Kendo
Once the HTML5 extension analysis is finished, the analyzer will output the final number of web service calls created.
Html.BeginForm
@using (Html.BeginForm("Setting", "Peopulse", FormMethod.Post, new { autocomplete = "off", id = "form-peopulseFtpSettings", @class = "block" })) { <input type="submit" name="Submit" /> }
Ajax.BeginForm
@using (Ajax.BeginForm("Setting", "Peopulse", new { //routeValues missionId = Model.Mission.Id, dayId = Model.MissionDayId, method="GET" }, new AjaxOptions { //Ajax setup UpdateTargetId = "synthesisLinesDiv", HttpMethod = "GET", InsertionMode = InsertionMode.Replace, }, new { //htmlAttributes Id = "form-selectSynthesis", //method="get" })) { }
Html.Action
@Html.Action("Delete", "Ctrl", new { id = item.ID })
Html.ActionLinkWithAccess
@Html.ActionLinkWithAccess(__("Add frequency interim summary"), "AddFrenquencyInterimSummary", null, new {@class = "btn popupLink"})
Html.ActionLink
@Html.ActionLink("Save", "SaveAction", "MainController", null, new { @class = "saveButton", onclick = "return false;" })
Ajax.ActionLink
@Ajax.ActionLink("x", "Delete", "NotificationMessenger", new { notific.Id }, new AjaxOptions() { HttpMethod = "POST", OnComplete = "DismissNotification" }, new { @class = "notification-close" })
Html.RenderAction
@Html.RenderAction("Delete", "Ctrl", new { id = item.ID })
Url.Action
@{ Html.RenderPartial("_EmployeesTable", @Url.Action("GetFrenquencyInterimSummary")); }
@using (Html.BeginForm("edit", "Employee", FormMethod.Post)) { <div class="form-horizontal"> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Save" name="Edit" formaction="@Url.Action("edit")" formmethod="post" class="btn btn-default"/> </div> </div> </div> }
@Html.PagedListPager(Model, page => Url.Action("Index", new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter}))
Url.RouteUrl
<a href="@(Url.RouteUrl(new{ action="DownloadFile", controller="DPScoreResults", id=Model.QuoteId, scoreRunId=Model.ScoreRunId}))" class="popupLink ico">
Kendo
<div> @(Html.Kendo().Grid<ElementControle>() .Name("gridElementsControle") .DataSource(datasource => datasource.Ajax() .Read(r => r.Action("GetElementsControle", "GestionUnitesTraitement")) ) ) </div>
Support for Marionette with Backbone framework
The following objects are supported:
Marionette application:
var eduApp = Marionette.Application.extend({ // called by marionette automatically when app is started onStart: function(options) { } });
Marionette view (the "template" item is important because it corresponds to the link between the view and an html/hbs file):
var overviewLayoutView = Marionette.LayoutView.extend({ template: overviewTemplate, initialize: function () { }, onShow: function () { } });
Backbone view:
var view = BaseView.extend({ initialize: function () { }, render: function () { } });
The following links are created:
- inheritance link between two views:
var ReviewBaseView = ValidatingStepBaseView.extend({ });
var ValidatingStepBaseView = Marionette.CompositeView.extend({});
- call link between Application and its "onStart" method:
- call link between View and its "onShow" method:
- call link from an Application or View function to a View:
var eduApp = Marionette.Application.extend({ onStart: function(options) { }, _showContentPage: function (model) { view = new OverviewLayoutView({model: model}); } });
- call link from an html/hbs file to the corresponding View, and to some view functions
In some cases (events), view functions are directly called from the html/hbs file. In this case, call links are created from the html/hbs file to the function:
var viewTemplate = require('as-combined-complete-t'); var AccountEnrollmentCompleteView = ValidatingStepBaseView.extend({ template: viewTemplate, events: { 'submit' : 'submit', 'click .acacomp-btn-prev': 'navigateToPreviousSlide', 'click .com-exit' : 'navigateToEnrollmentFlow' }, submit: function () { }, navigateToPreviousSlide: function () { }, navigateToEnrollmentFlow: function () { }, });
- call link from a view to another view functions (childEvents).
var TraditionalInvestmentItemView = require('traditional-investment-item-v'); var TraditionalContributionElectionView = Marionette.CompositeView.extend({ childEvents: { 'inputCleared': 'onChildInputCleared' }, childView: TraditionalInvestmentItemView, onChildInputCleared: function () { } });
var TraditionalInvestmentItemView = Marionette.CompositeView.extend({ }); module.exports = TraditionalInvestmentItemView;
Support for Apache Tiles framework
Apache Tiles are defined in xml files present mainly under the "WEB-INF" directory, but not always. "Apache Tiles definition" objects are created with links to jsp files. For example:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"> <tiles-definitions> <definition name="commonLayout" template="/WEB-INF/views/template/common_layout.jsp"> <put-attribute name="title" value="Access Care Planning"/> <put-attribute name="body"/> </definition> <definition name="service-documents-view" extends="commonLayout"> <put-attribute name="title" value="Service Management"/> <put-attribute name="body"> <definition template="/WEB-INF/views/configuration-menu/configuration-menu.jsp"> <put-attribute name="content" value="/WEB-INF/views/service-documents.jsp"/> </definition> </put-attribute> </definition> </tiles-definitions>
or
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd"> <tiles-definitions> <definition name="commonLayout" page="/WEB-INF/views/template/common_layout.jsp"> <put name="title" value="Access Care Planning"/> <put name="body"/> </definition> <definition name="service-documents-view" extends="commonLayout"> <put name="title" value="Service Management"/> <put name="body"> <definition page="/WEB-INF/views/configuration-menu/configuration-menu.jsp"> <put name="content" value="/WEB-INF/views/service-documents.jsp"/> </definition> </put> </definition> </tiles-definitions>
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"> <tiles-definitions> <definition name="landing.*" template="/pages/shop/templates/{1}/catalogLayout.jsp"> <put-attribute name="header" value="/pages/shop/templates/{1}/sections/header.jsp" /> <put-attribute name="navbar" value="/pages/shop/templates/{1}/sections/navbar.jsp" /> <put-attribute name="body" value="/pages/shop/templates/{1}/pages/landing.jsp" /> <put-attribute name="footer" value="/pages/shop/templates/{1}/sections/footer.jsp" /> </definition> </tiles-definitions>
In this case, several definitions are created, one for each folder present under the "/pages/shop/templates" folder.
"tiles:insertTemplate" in a jsp file:
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> <tiles:insertTemplate template="/WEB-INF/jsp/acctresrs/importPlanSmallHeader.jsp" flush="false" />
A link is created from the jsp file to importPlanSmallHeader.jsp.
Limitations
- definitions created directly in jsp files through "<tiles:insertDefinition>" or other tags starting with "tiles:" or "tilesx:" are not supported. They seem to be very rarely used and are not recommended.
- definitions created directly in java code are not supported.
Support for handlebars file
In HTML5/Javascript ≥ 2.1.29, the analyzer supports handlebars files (https://handlebarsjs.com/). This templating can be used in any kind of file type (javascript, HTML, text, or any other type). A detection process is carried out by the HTML5 extension to identify which kind of file represents the file. This is why a specific metamodel type "Handlebars Source Code" is created, and a HTML or Javascript fragment is created under this handlebars source code:
External libraries
In HTML5/Javascript ≥ 2.1.21, the analyzer is capable of finding external libraries using package.json files (dependencies and devDependencies sections). It creates external libraries under a folder named "HTML5 external libraries" directly under the project root. One external library is created for each couple (library name, version), and include links are created from the javascript sources to these libraries. Only called libraries are created. Each library object contains a property for the version. These objects are of the type "HTML5 JavaScript Source Code".
External libraries are also created when code like <script src="http://..../jquery.1.2.3.min.js"> is found in html files. The version is searched in the url (here 1.2.3) and the name is extracted (here jquery).
Support for contents of "node_modules" folder
In HTML5/Javascript ≥ 2.1.14, the analyzer is capable of scanning the contents of the "node_modules" folder which contains third-party external libraries. For every external item in the "node_modules" which is called by analyzed source code, a corresponding object will be created by the HTML5/JavaScript analyzer and therefore exposed in the analysis results. The items in the "node_modules" folder are not actually analyzed as such and are still ignored via an entry in the filters.json file. This is one part of a project to expose (in analysis results) called external libraries located in the "node_modules" folder.
By default, Console will ignore the "node_modules" folder (except in releases 2.5.x and 2.6.x) due to analysis performance issues. Therefore if you require this behaviour, you must manually remove the exclusion pattern knowing that your analysis times may increase:
Fast Scan onboarding
Legacy onboarding
End of comment and File skipped messages for .js files
You may find that the analysis log contains the following messages for .js files:
Warning MODULMSG ; Job execution end of comment '\*\/' not found 0 ; 0 0 0 [Module name] 0 0 Warning MODULMSG ; Job execution File skipped : K:\CAST\Ref\auto-refi2-staticresources\testing\inflow.js
These messages occur when the underlying Universal Analyzer raises a warning whenever it encounters what it considers a syntax error. The "End of comment" message is logged and then a following message is logged stating that the file has been "skipped". These warnings should be ignored as they have no impact: the HTML5/JavaScript extension will analyze the file and raise the following message in the analysis log:
Information MODULMSG ; Job execution [com.castsoftware.html5] Light parsing of file K:\CAST\CASTMS\Deploy\Test_source\Ref\auto-refi2-staticresources\testing\inflow.js