When your application uses Struts to service user requests, AppDynamics intercepts individual Struts Action invocations and names the user requests based on the Struts action names. A Struts entry point is a Struts Action that is being invoked.

AppDynamics supports the following versions of Struts:

  • Struts 1.x
  • Struts 2.x

Struts Action invocations are typically preceded by a dispatcher Servlet, but identification is deferred to the Struts Action. This ensures that the user requests are identified based on the Struts Action and not from the generic URL for Dispatcher Servlet. 

The response time for the Struts-based transaction is measured when the Struts entry point is invoked.

Struts Request Names

When a Struts Action is invoked, by default AppDynamics identifies the request using the name of Struts Action and the name of the method. All automatically discovered Struts-based transactions are thus named using the convention <Action Name>.<Method Name>.

For example, if an action called ViewCart is invoked with the SendItems(), the transaction is named ViewCart.SendItems.

For Struts 1.x the method name is always execute.

You can rename or exclude auto-discovered transactions. See Organize Business Transactions.

Custom Match Rules for Struts Transactions

For finer control over the naming of Struts-based transactions, use custom match rules.

A custom match rule lets you specify customized names for your Struts-based requests. You can also group multiple Struts invocations into a single business transaction using custom match rules. See Custom Match Rules for information about accessing the configuration screens.

The matching criteria for Struts transactions are: Struts Action class names, Struts Action names, and Struts Action method names.

Exclude Rules for Struts Actions or Methods

To prevent specific Struts Actions and methods from being monitored, add a custom exclude rule. The criteria for Struts exclude rules are the same as those for custom match rules. In particular, you may need to exclude custom-built dispatch servlets, as described next. 

Exclude Custom-built Dispatch Servlet

When a Struts action is called, it can demarcate a transaction as an entry point. AppDynamics instruments the Struts invocation handler to get the action name because the Struts action is not an interface. The invocation handler provides the Java Agent with the name of the action being invoked. If the dispatcher Servlet is custom-built and has not been excluded from instrumentation, the wrong entry point could be instrumented and the business transaction could be misidentified.

To address this issue, add a custom exclude rule for the dispatcher servlet or add a BCI exclude for it.