|
|
|
[
Permlink
| « Hide
]
tm_jee - [18/Dec/05 09:13 AM ]
I am not sure, but maybe Pat and Jason could give some more valueable feedback on this issue. I am guessing that this is one of those magic that was removed from pre-2.2 release.
Hi, tm_jee, thanks for your explaination.
But I think this feature is very important, and should not be removed. if it is been removed, it will result in expansion of xwork.xml, because very !command need a alias action declaration. and if we think this feature should not be supported, i recommend whether we may add a flag to webwork.properties, e.g. needCommand=true. if this flag is setted to true, this feature is there, or there is not this feature:-) >But I think this feature is very important, and should not be removed. if it is been removed, it will
>result in expansion of xwork.xml, because very !command need a alias action declaration I think the idea behind, is as you have pointed out to have an alias instead. If not mistaken the reason behind removing these "magics" are to make it easier for new people to get up using webwork. I guess the side effect will be rapid expansion of xwork.xml. The alternative would be to used <include file="..." /> to group related actions. :-) We'll just have to wait for the time being for Pat or Jason, to comment on this issue. I've send them an email and they should response soon. :-) My opinion would be that, given
Hi, Patrick, Thansk for your comment.
I understand your opinion, but if don't use !command pattern, it will result in the expansion of xwork.xml. is your solution same with the one provided by tm_jee who suggested me using <include file="..." /> to group related actions in order to avoid expansion of xwork.xml? or you have another suggestion? Anyway, thanks a lot. Sorry, I have found another problem about using !command.
I have a action defination as below <action name="sa.role" class="net.ema.examples.sa.presentation.RoleAction"> <result name="default" type="redirect">/sa.role!query.action</result> <result name="query">/sa/role_query.jsp</result> <result name="queryresult">/sa/role_query.jsp</result> <result name="view">/sa/role_view.jsp</result> <result name="create">/sa/role_create.jsp</result> <result name="update">/sa/role_update.jsp</result> <result name="create_valadate_error" type="chain">/sa.role!enterCreate.action</result> </action> I use filterdispatcher instead of servletdispatcher which has been deprecated according to http://wiki.opensymphony.com/display/WW/web.xml+2.1.x+compatibility. so I use result type chain, but got the error like below. I think it also has closed relationship with !command pattern's implementaion, am I right? com.opensymphony.xwork.config.ConfigurationException: There is no Action mapped for action name /sa.role!enterCreate.action at com.opensymphony.xwork.DefaultActionProxy.<init>(DefaultActionProxy.java:70) at com.opensymphony.xwork.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:39) at com.opensymphony.xwork.ActionChainResult.execute(ActionChainResult.java:111) at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:300) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:198) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:136) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:146) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:94) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180) at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:117) at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:172) at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:180) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:71) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:75) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:188) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) Hi, Patrick:
I checked source code of com.opensymphony.xwork.ActionChainResult, and found some code like below in execute method: ... proxy = ActionProxyFactory.getFactory().createActionProxy(finalNamespace, finalActionName, extraContext); proxy.execute(); ... did not judge if the finalActionName was !command, so I recommend modifying them like below: ... if (isActionCommand(finalActionName)) { proxy = ActionProxyFactory.getFactory().createActionProxy(finalNamespace, getActionName(finalActionName), extraContext); proxy.setMethod(getActionCommandName(finalActionName)); } else { proxy = ActionProxyFactory.getFactory().createActionProxy(finalNamespace, finalActionName, extraContext); } proxy.execute(); ... Remark: 1) isActionCommand is to judge if the action is a !command pattern 2) getActionName is to get the substring of action name before '!' 3) getActionCommandName is to get the substring of action name after '!' We've decided to get the 2.2 release out and then we'll put this in 2.3 (or Struts Action 2.0) soon after. Sorry about that, but we need to push the release out.
Resolving this as won't fix, cause foo!bar is going to be removed from SAF2 anyway.
See also http://forums.opensymphony.com/thread.jspa?threadID=30434&tstart=0 | ||||||||||||||||||||||||||||||||||||||||||||||