Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 93757 invoked from network); 9 Dec 2007 15:21:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Dec 2007 15:21:09 -0000 Received: (qmail 18536 invoked by uid 500); 9 Dec 2007 15:20:47 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 18508 invoked by uid 500); 9 Dec 2007 15:20:47 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 18497 invoked by uid 99); 9 Dec 2007 15:20:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2007 07:20:47 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ted.husted@gmail.com designates 209.85.198.188 as permitted sender) Received: from [209.85.198.188] (HELO rv-out-0910.google.com) (209.85.198.188) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2007 15:20:46 +0000 Received: by rv-out-0910.google.com with SMTP id c24so1120019rvf for ; Sun, 09 Dec 2007 07:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=/TtRB9tnDDBYLcg34v2CKbZfYUVjO8GlzNfuV/B2GlI=; b=a0nW6W28BXRYoEh5QEkGt3F0Rsz2a0VaYYdLZ5NBnobZaqbGidqmHUdjoOAtP2vK6CB7h90/vqHZiqpvrllIh87/9VBGkKjKcr8bgXNmZWlbWD6ZZuoJ+x0fiHJKo2WQqhhKJK8N14J0xnPYAKb8iti4QVzhRJLKvgDq9V1I2Y8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=co1sHhqjAts04JC04rza9dURGqCUSj6ojkOI8o66ufOQ5o5NkCNV1Rhkm/yWkdYPuJ9JejW7gFycn9E3BLY+h+ZHN8MVcY+2R3NriVdSF1kMXf35I4Zzag+NKf/OyMbO8NwqgkCYjVqB5erU9eLnL/qM0dgyGe0QnvQckFxM6a0= Received: by 10.140.180.11 with SMTP id c11mr1828503rvf.1197213624231; Sun, 09 Dec 2007 07:20:24 -0800 (PST) Received: by 10.141.62.8 with HTTP; Sun, 9 Dec 2007 07:20:24 -0800 (PST) Message-ID: <8b3ce3790712090720y71788347tbd5b9c97842ba6c0@mail.gmail.com> Date: Sun, 9 Dec 2007 10:20:24 -0500 From: "Ted Husted" Sender: ted.husted@gmail.com To: "Struts Users Mailing List" Subject: Re: Result Annotations and parameters In-Reply-To: <923966920@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <923966920@web.de> X-Google-Sender-Auth: 3f922e4863707019 X-Virus-Checked: Checked by ClamAV on apache.org Is the property actually "ID", as in "String getID()" ? Or is it getId() ? In the JPA MailReader code (see the sandbox), @Results like this one are working: @Result(name = Index.SUCCESS, value = Index.INDEX, type =ServletActionRedirectResult.class, params = {Index.USER, Index.USER_USERNAME }) where public static final String USER = "user"; public static final String USER_USERNAME = "${user.username}"; The end result is the that user parameter is appended to the query string for the redirect. -- HTH, Ted * On Dec 9, 2007 5:32 AM, Johannes Geppert wrote: > Does no one have a resolution for my problem? > With XML-Configuration it works perfectly. > But I like the Configuration with Annotations. > > I try it with Struts 2.1.0 and the codebehind plugin. > > Thank You > Johannes > > > > > > 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: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org