Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Struts2 dynamic call DMI and error Solution     - Ubuntu 12.04 installation DHCP Server (Server)

- CentOS / Linux install VNC Server (Linux)

- Installation JDK 1.8 under CentOS7 (Linux)

- Linux smart small switch rfkill (Linux)

- Based shell: using read, the command-line script to achieve mass participation and input two integer calculation (Programming)

- map and hash_map STL containers (Programming)

- CentOS replaces update source and Linux kernel compilation summary (Linux)

- Linux system commands to view hardware information (Linux)

- Ubuntu 14.04 compile, install, configure, the latest development version GoldenDict (Linux)

- Linux dd command make U disk boot disk (Linux)

- CentOS 7 Test Marathon start Docker container (Server)

- On the Web application attack techniques Common (Linux)

- Linux Network Programming - raw socket programming (Programming)

- How to use secure FTP file transfer (Server)

- How to update the Linux kernel to improve system performance (Linux)

- Install Java, Maven, Tomcat under Linux (Linux)

- Ubuntu server 8.04 Firewall Guide (Linux)

- 64-bit Oracle Linux recompiled Hadoop-2.2.0 (Server)

- Use the DBMS_SCHEDULER package to manage scheduled tasks (Database)

- Manual cleaning Oracle audit records (Database)

 
         
  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].

Solution:

 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" />
     
         
         
         
  More:      
 
- To compile and install Clang 3.5.0 in Linux CentOS (Linux)
- Getting Started with Linux system to learn: how to install the Shrew Soft IPsec VPN on Linux (Linux)
- The basic principle of pointers in C ++ (Programming)
- Use Visual Studio to compile and use WinGDB remote debugging embedded Linux programs (Programming)
- The Java ThreadLocal (Programming)
- How to remove the files inside the privacy of data on Linux (Linux)
- OpenJDK 7 compiled under Ubuntu 14.04.3 64-bit (Linux)
- Xshell upload files to achieve Windows host Linux (Linux)
- Zabbix monitors the status of TCP connections (Server)
- HTTP Client Hints Introduction (Server)
- Oracle can not change the tablespace to backup mode in non-archive mode (Database)
- How to add any of a Linux distribution beautiful fonts (Linux)
- The three-way division of the sorting algorithm Quicksort (Programming)
- Ubuntu install perfectly handsome terminal Guake 0.8.1 (Linux)
- Element content of Java HashSet change issues (Programming)
- Getting Started with Linux system to learn: how to get the process ID (PID) in the script (Linux)
- Hadoop2.0 configuration yarn success (Server)
- Fedora 22 install Adobe Flash Player (Linux)
- Linux System Getting Started Learning: Linux how to install 7zip (Linux)
- How to install Ubuntu applications Device 7 (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.