Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/348.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在action或dispatch action类中访问action标记(struts config.xml)的path属性?_Java_Struts_Struts 1_Url Mapping_Struts Config - Fatal编程技术网

Java 如何在action或dispatch action类中访问action标记(struts config.xml)的path属性?

Java 如何在action或dispatch action类中访问action标记(struts config.xml)的path属性?,java,struts,struts-1,url-mapping,struts-config,Java,Struts,Struts 1,Url Mapping,Struts Config,我使用的是未指定的DispatchAction方法,在这种情况下,我需要知道struts-config.xml中action标记的path属性的内容,因为这个action类用于两个action路径 例如: ... ... 我突出显示了路径和类型,以便更加集中 我想知道路径,因为我想设置不同的参数并相应地重定向流 请帮帮我。您可以从ActionMapping获取它。动作映射在执行时作为参数传递给动作 String path = mapping.getPath(); String path =

我使用的是未指定的DispatchAction方法,在这种情况下,我需要知道struts-config.xml中action标记的path属性的内容,因为这个action类用于两个action路径

例如:


...
...
我突出显示了路径和类型,以便更加集中

我想知道路径,因为我想设置不同的参数并相应地重定向流


请帮帮我。

您可以从
ActionMapping
获取它。动作映射在执行时作为参数传递给动作

String path = mapping.getPath();
String path = mapping.getPath();