Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Struts2 dynamic call DMI and error Solution     - How to contribute code on GitHub uploads (Linux)

- ORA-12154 TNS could not resolve the specified identifier (Database)

- DB2 table space is redirected to restore the database combat (Database)

- RedHat Linux 6.4 installation RTL8188CUS wireless network card driver (Linux)

- Linux RPM default installation path (Linux)

- Oracle table space rename and delete table space (Database)

- Git large file storage will help handle large binary files (Linux)

- Oracle Database ORA-01555 snapshot too old (Database)

- The user how to install Notepadqq 0.41.0 under ubuntu and debian (Linux)

- Linux system security knowledge (Linux)

- Spark read more HBase tables a RDD (Server)

- System with Windows Remote Desktop to connect Ubuntu 15.04 (Linux)

- ARM Linux system call (Linux)

- Cobbler batch install Ubuntu / CentOS system (Linux)

- Ubuntu 14.04 LTS 64-bit install GNS3 1.3.7 (Linux)

- Share and show your code on GitHub (Linux)

- Install RAID 6 (Striping double distributed parity) (Linux)

- Computer security perimeter recommendations (Linux)

- Docker build their own private warehouses (Linux)

- Understand ASP.NET 5 running the command: DNVM, DNX, and DNU (Server)

  Struts2 dynamic call DMI and error Solution
  Add Date : 2018-11-21      
  In Strust2 the action can define your own way, there are two ways to call a method, one way is struts.xml specified method to indicate the need to use the method, but this method disadvantage is that if there are many ways you Action in the to configure many times, this is very complicated, another method is to use a dynamic method invocation DMI.

To take a simple example -

For example, there LoginAction add, dell method,

1, the configuration file struts.xml

1 < package name = "default" extends = "struts-default">
2 < action name = "login" class = "com.action.loginAction">
3 < result name = "add"> / add.jsp < / result>
4 < result name = "dell"> / dell.jsp < / result>
5 < / action>
6 < / package>

2, the preparation method and add in loginAction the dell methods:

public String add ()
  return "add";
public String dell ()
  return "dell";

3, used in the link! Dynamic call the desired method:

< a href="login!add"> call the add method < /a>
< a href="login!dell"> call dell method < /a>

Common mistakes:

 There is no Action mapped for namespace [/ XXX] and action name [xxx! Xxx] associated with context path [/ xxx_method].


 The default is such Struts.xml

< Constant name = "struts.enable.DynamicMethodInvocation" value = "false" />

 We will be wrong in the address bar exclamation dynamic invocation method, we only need to change this sentence to

  < ! - Open the Struts DMI ->

 < Constant name = "struts.enable.DynamicMethodInvocation" value = "true" />
- To install MySQL on Linux (Database)
- IntelliJ IDEA run in Mac10.9 and JDK7 environment (Linux)
- VMware11 virtual machine Ubuntu14.10 system partition sda1 disk expansion (Linux)
- Quick paging ROW_NUMBER conducted (Database)
- CentOS installed JDK8 (Linux)
- Nine trick to let you speed up the old machine running Ubuntu Linux (Linux)
- Linux System Getting Started Learning: The Linux command line burn ISO or NRG image to DVD (Linux)
- Observation network performance tools for Linux (Linux)
- Articles do not resolve after opening under Ubuntu WordPress setting a fixed link (Server)
- DataGuard a hardware issue warnings found (Database)
- Present Situation and Development Trend of firewall products (Linux)
- Kubernetes cluster deployment (Server)
- How to ensure the Linux SSH login security with one-time password (Linux)
- Ubuntu update bug fixes Daquan (Linux)
- The need to avoid a gap of InnoDB lock (Database)
- SHELL script to use anti SSH brute force and vsftpd (Linux)
- C # mobile side and PC-side data exchange (Database)
- Ubuntu PPA install SMPlayer 14.9 (Linux)
- How to contribute code to the GNU Project (Linux)
- Android media library of analysis: MediaProvider (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.