Struts2-动态方法调用-Could not find action or result-Method update for action user is not allowed

动态方法调用时,异常

2016-12-16 09:42:43,166 ERROR [http-nio-8080-exec-6] dispatcher.Dispatcher (Dispatcher.java:599) - Could not find action or result: /web/user!update.action

com.opensymphony.xwork2.config.ConfigurationException: There is no Action mapped for namespace [/] and action name [user!update] associated with context path [/web].
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:192) ~[struts2-core-2.5.5.jar:2.5.5]
at org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:63) ~[struts2-core-2.5.5.jar:2.5.5]


Struts Problem Report
Struts has detected an unhandled exception:
Messages:

Method update for action user is not allowed!


struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
        "http://struts.apache.org/dtds/struts-2.5.dtd">
       
<struts>
	<constant name="struts.devMode" value="true" />
	<constant name="struts.configuration.xml.reload" value="true"></constant>
		
	<!-- 在2.5版本,是否启用动态调用有个选项,默认值为false 想启用的话, 要改成true -->
	<constant name="struts.enable.DynamicMethodInvocation" value="true"/>  
			
	<!-- strict-method-invocation在2.5版本,为了限制DMI,默认启用了严格的方法访问,不想启用要改为false -->
	<package name="default"  extends="struts-default" strict-method-invocation="false">  
	
		<!-- 在2.5版本,想要使用通配符,增加这个选项 -->
		<global-allowed-methods>regex:.*</global-allowed-methods> 
		
	     <action name="user" class="com.action.UserAction">
			<result name="hello">/hello.jsp</result>  
			<result name="update">/update.jsp</result>   
		</action>
	</package>
</struts>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值