Hello,

i try to use the Result Annotations  in my new Project, this works fine for me.
But when I try to use parameters I become an Exception.

Config:
@Namespace(value="/")
@Results( {
    @Result(value = "myresult.action", type = 
ServletActionRedirectResult.class, params={"ID","${ID}"}),
    @Result(value = "/pages/search.jsp", name="input")
        })
public class Search extends BaseSupport


In the log I found following messages:
DEBUG (org.apache.struts2.config.ClasspathPackageProvider:58) - 
ClasspathPackageProvider: Processing class de.geppert.actions.Search
DEBUG (org.apache.struts2.config.ClasspathPackageProvider:58) - Adding 
parmeter[ID:${ID}] to result.

this looks fine but I when I use this Action It returned a NullPointerException 
and following log messages:

ERROR (com.opensymphony.xwork2.DefaultActionInvocation:28) - There was an 
exception while instantiating the result of type 
org.apache.struts2.dispatcher.ServletActionRedirectResult
Caught OgnlException while setting property 'ID' on type 
'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class: 
ognl.ObjectPropertyAccessor
File: ObjectPropertyAccessor.java
Method: setProperty
Line: 132 - ognl/ObjectPropertyAccessor.java:132:-1
        at 
com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:400)
        at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:87)
        at 
com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperties(OgnlReflectionProvider.java:55)
        at 
com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:222)
        at 
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:201)
        at 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:349)
        at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:259)
        at 
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:141)
        at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:85)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
        at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
        at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:248)
        at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
        at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:85)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
        at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
        at 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:124)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
        at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
        at 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:170)
        at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:85)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
        at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
        at 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:104)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
        at 
com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
        at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

Can anybody resolve my problem?  I think my configuration has no errors, 
because my Actions without parameters work fine.

Best Regards
Johannes Geppert


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to