Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Struts2 dynamic call DMI and error Solution     - UNIX file permissions in the "set user ID bit" (Linux)

- 11G ASM disk group does not automatically handle MOUNT (Database)

- Linux fast set ip bond (Linux)

- To create a problem by the statement date comparison of the difference between MySQL and Oracle (Database)

- Linux system security configuration (Linux)

- Linux startup and logon security settings (Linux)

- Linux how to view the graphics models notebook (Linux)

- To control based on IP address routing policy under Linux (Linux)

- Oracle PLS-00231 error analysis (Database)

- Memcached and Redis (Linux)

- To setup Cocos2dx project under Ubuntu (Linux)

- Different versions of MongoDB achieve master-slave replication (Database)

- Mahout source code analysis: FP-Growth algorithm parallelization (Programming)

- Android View event delivery (Programming)

- MySQL TIMESTAMP and DATETIME (Database)

- Oracle 12C RAC optimizer_adaptive_features cause of data into overtime (Database)

- Android Studio interface-related settings (Linux)

- Why do I prefer Git (Linux)

- DataGuard the MRP can not start to analyze and solve problems (Database)

- Android HTTP request with Get Information (Programming)

 
         
  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:      
 
- Linux iptables firewall settings (Linux)
- Configuring LIDS build Linux kernel security intrusion detection system (Linux)
- jQuery plugin dynamic label generation (Linux)
- sqlplus connect to Oracle (Database)
- C ++ sequence containers basics summary (Programming)
- To obtain installation package (RPM) under RHEL6 (Linux)
- MySQL Installation Troubleshooting (Database)
- To create someone else can not afford to delete the administrator user (Linux)
- SHELL script to use anti SSH brute force and vsftpd (Linux)
- systemd-nspawn Quick Guide (Linux)
- The signature can not be verified under Debian (Linux)
- Memcached installation, configuration and monitoring (Server)
- Install Web-based monitoring tool: Linux-Dash (Server)
- Fedora 20 users install the Mate 1.8 desktop (Linux)
- Build your own Web server under Ubuntu Linux system (Server)
- How to Install Puppet in the Ubuntu 15.04 (Server)
- To install MySQL on Linux (Database)
- The virtual memory (Linux)
- How to Upgrade Ubuntu GNOME 14.10 to GNOME 3.16 Desktop (Linux)
- The easiest 11g Active DataGuard (ADG) to establish the configuration process (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.