Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Struts2 dynamic call DMI and error Solution     - osprofiler use OpenStack Cinder Lane (Server)

- MySQL Tutorial: Some optimized for I / O memory areas (Database)

- RHEL6.4 x86_64 build SVN service (Server)

- The best known for archiving / compression tool under linux (Linux)

- Linux NIC driver and version information (Linux)

- Under CentOS Linux automatic backup MySQL database daily (Database)

- Linux Open coredump (Linux)

- C / C ++ language usage summary of const (Programming)

- Using DBMS_STAT function closes mission (Database)

- stat - Get more information than ls (Linux)

- xargs Detailed description (Linux)

- To configure linux transparent firewall (Linux)

- Ubuntu 14.10 PPA installed Android Studio (Linux)

- C ++ class implementation date operator overloading (Programming)

- STL source code analysis - iterator each container classification (Programming)

- Kali Linux 2.0 U disk installation errors Your installation cd-rom could not be mounted (Linux)

- OpenStack / Dev stack with neutron on Ubuntu 14.04 (Server)

- impdp error ORA-31631, ORA-39122 (Database)

- MySQL High Availability plan several options (Database)

- Using the Android interface in Parcelable (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].


 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" />
- Linux server is how to do after the invasion (Linux)
- Linux CPU Monitoring Index (Linux)
- How to make GRub instead of the default Ubuntu software center (Linux)
- File encryption and decryption of Linux security mechanisms (Linux)
- Installation of Python2.7.8 and iPython under CentOS6.5 (Linux)
- Linux System Administrator common interview questions and answers 30 (Linux)
- Linux Learning --- disk partition / relational representation + mount (Linux)
- Firewall chapter of Linux server security configuration (Linux)
- Three kinds of implementation model of the Linux thread history (Programming)
- Copy U disk files to the Linux system on a virtual machine (Linux)
- After installation of Debian 6.0 do a few things first (Linux)
- MySQL performance view and configure finishing Daquan (Database)
- Linux file and directory management - ls, cp, mv (Linux)
- Docker study notes (Server)
- Repair CentOS 6.4 Grub boot (Linux)
- Linux three ways to set environment variables (Linux)
- Ubuntu install Tonido private cloud services (Server)
- Spring + Log4j + ActiveMQ remote logging - Analysis of combat (Server)
- Install NetBeans IDE 8.0 on Ubuntu, Linux Mint, Elementary OS, and Debian (Linux)
- A custom implementation of the Android sidebar (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.