---
title: "【struts2】赵雅智_动态方法调用"
author: "赵雅智"
date: "2013-02-28T20:05:00Z"
tags: []
slug: "struts2"
draft: false
lastmod: "2013-04-24T09:54:12Z"
id: 1852460
url: "https://503382003.iteye.com/blog/1852460"
---

Struts2默认支持动态方法调用

动态方法调用的常量配置：

&lt;!–该属性设置Struts2是否支持动态方法调用，该属性的默认值是true。如果需要关闭动态方法调用，则可设置该属性为false。--&gt;

&lt;constant

name="struts.enable.DynamicMethodInvocation"value="false"/&gt;

文件上传：

&lt;!--上传文件的大小限制--&gt;1kb

&lt;constantname="struts.multipart.maxSize"value=“1024"/&gt;

什么是动态方法的调用呢?

[http://localhost:8080/struts\_dynamic/csdn/delete!adds.action](http://localhost:8080/struts_dynamic/csdn/delete!adds.action)

action中有一个

![](http://img.my.csdn.net/uploads/201302/28/1362051138_9287.png)

struts.xml文件中

![](http://img.my.csdn.net/uploads/201302/28/1362051155_7718.png)

[http://localhost:8080/struts\_dynamic/](http://localhost:8080/struts_dynamic/csdn/delete!adds.action)csdn/action名称!方法名称.action