@NotNull
public PsiReference[] getReferencesByElement(@NotNull final PsiElement psiElement,
@NotNull final ProcessingContext context) {
final StrutsManager strutsManager = StrutsManager.getInstance(psiElement.getProject());
final StrutsModel strutsModel = strutsManager.getCombinedModel(psiElement);
if (strutsModel == null) {
return PsiReference.EMPTY_ARRAY;
}
final XmlAttributeValue xmlAttributeValue = (XmlAttributeValue) psiElement;
final String path = xmlAttributeValue.getValue();
// resolve to <action>
final String actionName = TaglibUtil.trimActionPath(path);
final String namespace = getNamespace(xmlAttributeValue);
final List<Action> actions = strutsModel.findActionsByName(actionName, namespace);
final Action action = actions.isEmpty() ? null : actions.get(0);
final int bangIndex = StringUtil.indexOf(path, TaglibUtil.BANG_SYMBOL);
if (bangIndex == -1) {
return new PsiReference[]{new ActionReference(xmlAttributeValue, action, namespace, strutsModel)};