Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Struts2 dynamic call DMI and error Solution     - Use HugePages optimize memory performance (Database)

- Use source packages compiled and installed GCC5.1 in Mac OS X 10.10.3 (Linux)

- Go performed using iOS and Android programming (Programming)

- Ubuntu Locale configuration problem solving Can not set LC_CTYPE (Linux)

- Ganglia Python plug-in the process of writing notes (Linux)

- In-depth summary of the PHP core of object-oriented (Programming)

- To install minimize RHEL / CentOS 7 (Linux)

- Linux Beginner Guide: Installing packages on Ubuntu and Fedora (Linux)

- Compile and install GCC 4.8.1 + GDB 7.6.1 + Eclipse in CentOS 6.4 in (Linux)

- PostgreSQL 9.4.3 Installation and Configuration under CentOS 6.5 (Database)

- Oracle 11g contraction table space error ORA-03297: file contains used data beyondrequested RESIZE value (Database)

- Android development environment to build under Fedora 13 (Linux)

- Can not remember how to solve the problem under Ubuntu brightness setting (Linux)

- The most commonly used Linux commands (Linux)

- CentOS 6.5 installation and configuration Cobbler (Server)

- Transplant spider to MySQL 5.6 (Database)

- Getting Started with Linux system to learn: how to install autossh (Linux)

- Cobbler Add custom YUM source (Linux)

- Configuring a Linux operating system security management services Explain (Linux)

- MySQL optimization resulting order by using filesort (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:      
 
- How to manage and use Logical Volume Management LVM in Ubuntu (Linux)
- Try debugfs restore the deleted files ext3 file system (Linux)
- CentOS install pip (Linux)
- Install Jetty on CentOS / RHEL 6.X (Server)
- Ubuntu Live CD by updating Grub resume boot the Boot Menu (Linux)
- Python format string (Programming)
- Without Visual Studio .NET Windows application development (Programming)
- CentOS 6 compiling httpd-2.4.10 (Server)
- Installation under Linux to deploy Java (Linux)
- Axel install plug under CentOS 5/6 acceleration yum downloads (Linux)
- Why not use the ifconfig command under RedHat Linux 5 (Linux)
- secureCRT remote login Linux must first open the connection protocol (Linux)
- Installation and deployment of MariaDB under CentOS (Database)
- Use PuTTY to access the virtual machine Linux under Windows xp (Programming)
- Use Mop monitor stock prices at the Linux command line (Linux)
- Java Database Programming JDBC configuration (Programming)
- Simple configuration shell scripts virtual machine environment experiment (Linux)
- C ++ Supplements - References (Lvalue Reference, Rvalue Reference) (Linux)
- Ubuntu configuration SVN and http mode access (Server)
- CentOS 6.5 install VNC-Server (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.