Related pages: |
This page describes how to instrument a browser application through assisted injection of the JavaScript Agent. Assisted injection is when your server-side application injects the JavaScript Agent into your browser application. You can configure your business applications to inject the JavaScript Agent into your browser applications.
You can perform assisted injection with rules or through attributes. This table summarizes the platforms supported for each type of assisted injection and the process for performing the assisted injection.
Type of Assisted Injection | Supported Platforms | Description |
---|---|---|
Injection Rules | Java | Type of assisted injection uses rules to configure which Java classes should be intercepted. You create the injection rules in the User Experience App Integration Panel of the Controller UI for the business application that will inject the JavaScript Agent. |
Attribute Injection | Java, ASP.NET | Type of assisted injection relies on templates that tell the app agent where to inject information. You enable attribute injection in the User Experience App Integration Panel of the Controller UI for the business application that will inject the JavaScript Agent. Additionally, you add code snippets in the page templates that determine where the JavaScript Agent is injected. |
To have your server-side application use assisted injection of the JavaScript Agent using injection rules, you define rules to configure:
Assisted injection using rules is available for Java frameworks only. |
Check the Is this Method Overloaded? checkbox.
<DOCTYPE. . . >
To have your server-side application use assisted injection of the JavaScript Agent using attribute injection, you:
Only Servlet containers supported assisted injection. |
These examples show code snippets that you can copy directly into your page templates or into other pages. These code snippets direct the app agent where to inject information. The header value must be injected at the very top of the <head>
section and the footer value must be added at the very end of the code creating the page.
If you have already injected the header portion of the agent using manual injection, you can use these code snippets to automatically inject the footer data portion only. In this case, add only the JS_FOOTER
values shown in the sections below.
<h:outputText rendered="#{AppDynamics_JS_HEADER != null}" value='#{request.getAttribute("AppDynamics_JS_HEADER")}' escape="false"/> <h:outputText rendered="#{AppDynamics_JS_FOOTER != null}" value='#{request.getAttribute("AppDynamics_JS_FOOTER")}' escape="false"/> |
<% if (request.getAttribute("AppDynamics_JS_HEADER") != null) { %> <%=request.getAttribute("AppDynamics_JS_HEADER")%> <% } %> <% if (request.getAttribute("AppDynamics_JS_FOOTER") != null) { %> <%=request.getAttribute("AppDynamics_JS_FOOTER")%> <% } %> |
if (request.getAttribute("AppDynamics_JS_HEADER") != null) { out.write(request.getAttribute("AppDynamics_JS_HEADER".toString()); } if (request.getAttribute("AppDynamics_JS_FOOTER") != null) { out.write(request.getAttribute("AppDynamics_JS_FOOTER").toString()); } |
<g:if test="${AppDynamics_JS_HEADER}"> ${AppDynamics_JS_HEADER} </g:if> <g:if test="${AppDynamics_JS_FOOTER}"> ${AppDynamics_JS_FOOTER} </g:if> |
#if ($AppDynamics_JS_HEADER) $AppDynamics_JS_HEADER #end #if ($AppDynamics_JS_FOOTER) $AppDynamics_JS_FOOTER #end |
<% if (Context.Items.Contains("AppDynamics_JS_HEADER")) Response.Write(Context.Items["AppDynamics_JS_HEADER"]); %> <% if (Context.Items.Contains("AppDynamics_JS_FOOTER")) Response.Write(Context.Items["AppDynamics_JS_FOOTER"]); %> |
@if(HttpContext.Current.Items.Contains("AppDynamics_JS_HEADER")) { @Html.Raw((string)HttpContext.Current.Items["AppDynamics_JS_HEADER"]) } @if(HttpContext.Current.Items.Contains("AppDynamics_JS_FOOTER") ) { @Html.Raw(HttpContext.Current.Items["AppDynamics_JS_FOOTER"].ToString()) } |