Questions tagged [dmi]

Dynamic Method Invocation (DMI) is a feature of Struts2 framework that lets the "!" (bang) character invoke a method other than `execute`.

Dynamic Method Invocation (DMI) is a feature of Struts2 framework that lets the "!" (bang) character invoke a method other than execute. The "!" character added to the URL after the action name and followed by a method name to execute. The difference with the mapping actions in this way as the opposite where the action is mapped directly to the method in the action configuration the any other method could be executed regardless of the method configured or the method execute which is used by default.

This feature is configurable by the property or constant struts.enable.DynamicMethodInvocation which can take values true or false. By default this feature is enabled.

Since Struts 2.3, an option was added to restrict the methods that DMI can invoke. You can use the attribute strict-method-invocation="true" of the package tag. In this case Struts will reject any method that is not defined in the method attribute or allowed-methods of the action tag.

Documentation: http://struts.apache.org/docs/action-configuration.html#ActionConfiguration-DynamicMethodInvocation

30 questions
7
votes
2 answers

Struts 2.3 form with multiple submit tags with action attribute

This is something quite simple which worked perfectly with Struts 2.1.x. But we recently upgraded to 2.3.15.2 and it broke. Basically we have a form (actually, many forms) with multiple submits:
Robert Bowen
  • 487
  • 2
  • 13
  • 24
6
votes
3 answers

Struts 2 S2-016 Vulenerability Mitigation Till Upgrade

Recently Struts patched a vulnerability allowing attackers to execute remote code. Apparently not patching this is like giving black-hats a red carpet welcome with a bandwagon. http://struts.apache.org/release/2.3.x/docs/s2-016.html Basically it…
Thihara
  • 7,031
  • 2
  • 29
  • 56
5
votes
3 answers

Action mapping not working after migrating from Struts 2.3.12 to 2.3.20

Currently I am using Struts 2.3.12 in my project and all the things are working fine. Now I have requirement to upgrade Struts version to 2.3.20 to address some security issue. I changed the Struts and required Struts plugins version to 2.3.20 in my…
S Panday
  • 61
  • 1
  • 6
4
votes
1 answer

How to exclude the submit action from a list of parameters in Struts 2?

I'm trying to exclude a submit action from a parameter list. The following is the action class: @Namespace("/admin_side") @ResultPath("/WEB-INF/content") @InterceptorRefs({ @InterceptorRef(value="validation", params={"excludeMethods", "test"}), …
Tiny
  • 27,221
  • 105
  • 339
  • 599
4
votes
2 answers

Multiple Entrypoints in Struts Action (Migration Struts 2.2.3 -> 2.3.1)

I have an action in struts.xml: reprint /x …
Thomas Junk
  • 5,588
  • 2
  • 30
  • 43
4
votes
2 answers

Error 404 issues using Struts application

I am having some issues running a Struts web app since few days. I tried several solutions from StackOverflow relating to my problem but none of them works. web.xml: Struts2 Application
Manish Basdeo
  • 6,139
  • 22
  • 68
  • 102
4
votes
2 answers

How to handle multiple actions in a single form in Struts 2

I have a form contains three buttons print/export/save.
gmeka
  • 4,269
  • 3
  • 25
  • 25
3
votes
1 answer

How to use annotation @AllowedMethods to implement a dynamic method invocation in Struts 2.5?

The action code: @ParentPackage("basePackage") @Namespace("/") @Action(value = "userAction") @AllowedMethods("test") public class UserAction { private static final String[] test = null; private static Logger logger =…
Red spider
  • 31
  • 2
3
votes
1 answer

Should / Can I make Struts 2 conventions to forget about an action's execute() method?

I am doing my first steps with Struts 2 and the struts2-convention-plugin, currently working on a CRUD action class (SongCrudAction) with some typical create(), edit(), view() and delete() action methods. All those methods are annotated with…
user1992821
  • 268
  • 2
  • 6
2
votes
1 answer

Upgrading from Struts2 2.1 to 2.5

I am trying to do a redirectAction to another class, and to invoke a specific method in that class. Basically, when the user hits an "Edit" link in a cell in a table, we get that object and put it into the Session, and then invoke the Editor…
Tom
  • 51
  • 1
  • 3
2
votes
0 answers

How to get OEM information via Python-dmidecode module

How do I retrieve dmidecode (type 204) information using Python dmidecode module? I'm using Linux Redhat on HP Hardware. Here's what I'm looking for (except that I want it via Python): > dmidecode --type 204 # dmidecode 2.11 SMBIOS 2.7…
tomikos
  • 51
  • 2
2
votes
1 answer

WARNING: No configuration found for the specified action: in namespace: Form action defaulting to 'action' attribute's literal value

I am trying to find the namespace and action name with wildcards but it gets failed. Exception : WARNING: No configuration found for the specified action: '/checkMethods/executeCRUD' in namespace: ''. Form action defaulting to 'action' attribute's…
sunleo
  • 10,589
  • 35
  • 116
  • 196
1
vote
2 answers

Why method prefix not working in Struts 2.3.32

I use Struts 2.3.32 and this is the code. methodPrefix.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %>
Rikimaru
  • 23
  • 3
1
vote
1 answer

How do I handle multiple actions in single form in wildcard action mapping?

According this solution Struts2 handle multiple actions... I know the Struts2 DMI can handle multiple acitons in single form easily. Recently, Struts2 turned off DMI mechanism for security issue. Now, we use Wildcard Mappings to map all actions in…
Ashkandi
  • 63
  • 2
  • 12
1
vote
1 answer

Upgrading Struts 2.3.16.2 libraries caused error

Recently, I need to upgrade Struts2 libraries from 2.3.15.1 to 2.3.16.2. First all, I upgraded those…
Ashkandi
  • 63
  • 2
  • 12
1
2