Re: help with MethodFailedException in ognl.OgnlRuntime.callAppropriateMethod
Nope, my bad. After a full refactor I get the same error. Below are snippets of the new code and most recently generated error. Stack Trace excerpt: 2011-05-02 21:24:49,887 175361 ["http-bio-8080"-exec-7] WARN com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression 'tagId' with value '[Ljava.lang.String;@1e73e0d' ognl.MethodFailedException: Method "setTagId" failed for object org.robbins.flashcards.model.Tag@144dc7b [name='my tag' ] [java.lang.NoSuchMethodException: org.robbins.flashcards.model.Tag.setTagId([Ljava.lang.String;)] at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285) at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474) JSP excerpt: POJO excerpt: public class Tag implements java.io.Serializable { private int tagId; public int getTagId() { return this.tagId; } public void setTagId(int tagId) { this.tagId = tagId; } On Mon, May 2, 2011 at 8:53 PM, Justin Robbins wrote: > I tested it just now and I do NOT get the error when I refactor the > code from the POJO on down to the JSP to use "myId" instead of "id". > > On Mon, May 2, 2011 at 8:43 PM, Dave Newton wrote: >> Just out of curiosity, does it do the same thing if it's not named "id"? >> >> d. >> >> On Mon, May 2, 2011 at 8:32 PM, Justin Robbins >> wrote: >>> Anyone have any ideas on this one? I'd be most grateful for some advice. >>> >>> Someone suggested I use a newer version of the ognl jar. I was using >>> "ognl-3.0.jar" which is what came with the Struts 2.2.1.1 >>> distribution. I've since replaced it with "ognl-3.0.1.jar" but I'm >>> still receiving the same error. >>> >>> Any help is greatly appreciated. >>> >>> On Mon, May 2, 2011 at 11:26 AM, Justin Robbins >>> wrote: Hi folks, I have a working Action and JSP form that I'm using for creating new entities in my very basic Struts 2.2.1.1 app. I'm trying to modify the app to re-use the JSP form with editing of entities. I added a hidden "ID" tag and now I'm getting errors when I submit the form. Can someone please give me some assistance? I've Googled this issue and seen others posting similar errors but I'm not sure how to resolve it. Excerpt from Stack Trace when I submit the form: 2011-05-02 11:09:36,132 3198497 ["http-bio-8080"-exec-23] WARN com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression 'id' with value '[Ljava.lang.String;@100ac03' ognl.MethodFailedException: Method "setId" failed for object org.robbins.flashcards.model.Tag@1b9eb34 [name='null' ] [java.lang.NoSuchMethodException: org.robbins.flashcards.model.Tag.setId([Ljava.lang.String;)] at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285) at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474) Excerpt from JSP: <%@ taglib prefix="s" uri="/struts-tags"%> ... Excerpt from Action Class: public class TagAction extends FlashCardsAppBaseAction implements ModelDriven { Tag tag = new Tag(); public Tag getTag() { return tag; } public void setTag(Tag tag) { this.tag = tag; } public String createTag() { ... } } Excerpt from POJO: public class Tag implements java.io.Serializable { private int id; private String name; public int getId() { return this.id; } public void setId(int id) { this.id = id; } ... } Excerpt from Struts.xml >>> class="org.robbins.flashcards.presentation.TagAction" method="createTag"> displaytag.tiles tagform.tiles -- Regards, Justin >>> >>> >>> >>> -- >>> Regards, >>> Justin Robbins >>> 973.479.0448 >>> justinhrobb...@gmail.com >>> >>> Learn more about me by viewing my professional profile on LinkedIn >>> http://www.linkedin.com/in/justinhrobbins >>> >>> View my professional blog >>> http://javadeveloperjournal.blogspot.com/ >>> >>> - >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@struts.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > > -- > Regards, > Justin Robbins > 973.479.0448 > justinhrobb...@gmail.com > > Learn more about me by viewing my professional profile on LinkedIn > http://www.linkedin.com/in/justinhrobbins > > View my professional
Re: help with MethodFailedException in ognl.OgnlRuntime.callAppropriateMethod
I tested it just now and I do NOT get the error when I refactor the code from the POJO on down to the JSP to use "myId" instead of "id". On Mon, May 2, 2011 at 8:43 PM, Dave Newton wrote: > Just out of curiosity, does it do the same thing if it's not named "id"? > > d. > > On Mon, May 2, 2011 at 8:32 PM, Justin Robbins > wrote: >> Anyone have any ideas on this one? I'd be most grateful for some advice. >> >> Someone suggested I use a newer version of the ognl jar. I was using >> "ognl-3.0.jar" which is what came with the Struts 2.2.1.1 >> distribution. I've since replaced it with "ognl-3.0.1.jar" but I'm >> still receiving the same error. >> >> Any help is greatly appreciated. >> >> On Mon, May 2, 2011 at 11:26 AM, Justin Robbins >> wrote: >>> Hi folks, >>> >>> I have a working Action and JSP form that I'm using for creating new >>> entities in my very basic Struts 2.2.1.1 app. I'm trying to modify >>> the app to re-use the JSP form with editing of entities. I added a >>> hidden "ID" tag and now I'm getting errors when I submit the form. >>> Can someone please give me some assistance? I've Googled this issue >>> and seen others posting similar errors but I'm not sure how to resolve >>> it. >>> >>> Excerpt from Stack Trace when I submit the form: >>> 2011-05-02 11:09:36,132 3198497 ["http-bio-8080"-exec-23] WARN >>> com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression >>> 'id' with value '[Ljava.lang.String;@100ac03' >>> ognl.MethodFailedException: Method "setId" failed for object >>> org.robbins.flashcards.model.Tag@1b9eb34 [name='null' ] >>> [java.lang.NoSuchMethodException: >>> org.robbins.flashcards.model.Tag.setId([Ljava.lang.String;)] >>> at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285) >>> at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474) >>> >>> Excerpt from JSP: >>> <%@ taglib prefix="s" uri="/struts-tags"%> >>> ... >>> >>> >>> >>> >>> >>> >>> Excerpt from Action Class: >>> public class TagAction extends FlashCardsAppBaseAction implements >>> ModelDriven { >>> >>> Tag tag = new Tag(); >>> >>> public Tag getTag() { >>> return tag; >>> } >>> >>> public void setTag(Tag tag) { >>> this.tag = tag; >>> } >>> public String createTag() { >>> ... >>> } >>> } >>> >>> Excerpt from POJO: >>> public class Tag implements java.io.Serializable { >>> >>> >>> private int id; >>> private String name; >>> >>> public int getId() { >>> return this.id; >>> } >>> >>> public void setId(int id) { >>> this.id = id; >>> } >>> ... >>> } >>> >>> Excerpt from Struts.xml >>> >> class="org.robbins.flashcards.presentation.TagAction" >>> method="createTag"> >>> displaytag.tiles >>> tagform.tiles >>> >>> >>> -- >>> Regards, >>> Justin >>> >> >> >> >> -- >> Regards, >> Justin Robbins >> 973.479.0448 >> justinhrobb...@gmail.com >> >> Learn more about me by viewing my professional profile on LinkedIn >> http://www.linkedin.com/in/justinhrobbins >> >> View my professional blog >> http://javadeveloperjournal.blogspot.com/ >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Regards, Justin Robbins 973.479.0448 justinhrobb...@gmail.com Learn more about me by viewing my professional profile on LinkedIn http://www.linkedin.com/in/justinhrobbins View my professional blog http://javadeveloperjournal.blogspot.com/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: help with MethodFailedException in ognl.OgnlRuntime.callAppropriateMethod
Just out of curiosity, does it do the same thing if it's not named "id"? d. On Mon, May 2, 2011 at 8:32 PM, Justin Robbins wrote: > Anyone have any ideas on this one? I'd be most grateful for some advice. > > Someone suggested I use a newer version of the ognl jar. I was using > "ognl-3.0.jar" which is what came with the Struts 2.2.1.1 > distribution. I've since replaced it with "ognl-3.0.1.jar" but I'm > still receiving the same error. > > Any help is greatly appreciated. > > On Mon, May 2, 2011 at 11:26 AM, Justin Robbins > wrote: >> Hi folks, >> >> I have a working Action and JSP form that I'm using for creating new >> entities in my very basic Struts 2.2.1.1 app. I'm trying to modify >> the app to re-use the JSP form with editing of entities. I added a >> hidden "ID" tag and now I'm getting errors when I submit the form. >> Can someone please give me some assistance? I've Googled this issue >> and seen others posting similar errors but I'm not sure how to resolve >> it. >> >> Excerpt from Stack Trace when I submit the form: >> 2011-05-02 11:09:36,132 3198497 ["http-bio-8080"-exec-23] WARN >> com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression >> 'id' with value '[Ljava.lang.String;@100ac03' >> ognl.MethodFailedException: Method "setId" failed for object >> org.robbins.flashcards.model.Tag@1b9eb34 [name='null' ] >> [java.lang.NoSuchMethodException: >> org.robbins.flashcards.model.Tag.setId([Ljava.lang.String;)] >> at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285) >> at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474) >> >> Excerpt from JSP: >> <%@ taglib prefix="s" uri="/struts-tags"%> >> ... >> >> >> >> >> >> >> Excerpt from Action Class: >> public class TagAction extends FlashCardsAppBaseAction implements >> ModelDriven { >> >> Tag tag = new Tag(); >> >> public Tag getTag() { >> return tag; >> } >> >> public void setTag(Tag tag) { >> this.tag = tag; >> } >> public String createTag() { >> ... >> } >> } >> >> Excerpt from POJO: >> public class Tag implements java.io.Serializable { >> >> >> private int id; >> private String name; >> >> public int getId() { >> return this.id; >> } >> >> public void setId(int id) { >> this.id = id; >> } >> ... >> } >> >> Excerpt from Struts.xml >> > class="org.robbins.flashcards.presentation.TagAction" >> method="createTag"> >> displaytag.tiles >> tagform.tiles >> >> >> -- >> Regards, >> Justin >> > > > > -- > Regards, > Justin Robbins > 973.479.0448 > justinhrobb...@gmail.com > > Learn more about me by viewing my professional profile on LinkedIn > http://www.linkedin.com/in/justinhrobbins > > View my professional blog > http://javadeveloperjournal.blogspot.com/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: help with MethodFailedException in ognl.OgnlRuntime.callAppropriateMethod
Anyone have any ideas on this one? I'd be most grateful for some advice. Someone suggested I use a newer version of the ognl jar. I was using "ognl-3.0.jar" which is what came with the Struts 2.2.1.1 distribution. I've since replaced it with "ognl-3.0.1.jar" but I'm still receiving the same error. Any help is greatly appreciated. On Mon, May 2, 2011 at 11:26 AM, Justin Robbins wrote: > Hi folks, > > I have a working Action and JSP form that I'm using for creating new > entities in my very basic Struts 2.2.1.1 app. I'm trying to modify > the app to re-use the JSP form with editing of entities. I added a > hidden "ID" tag and now I'm getting errors when I submit the form. > Can someone please give me some assistance? I've Googled this issue > and seen others posting similar errors but I'm not sure how to resolve > it. > > Excerpt from Stack Trace when I submit the form: > 2011-05-02 11:09:36,132 3198497 ["http-bio-8080"-exec-23] WARN > com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression > 'id' with value '[Ljava.lang.String;@100ac03' > ognl.MethodFailedException: Method "setId" failed for object > org.robbins.flashcards.model.Tag@1b9eb34 [name='null' ] > [java.lang.NoSuchMethodException: > org.robbins.flashcards.model.Tag.setId([Ljava.lang.String;)] > at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285) > at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474) > > Excerpt from JSP: > <%@ taglib prefix="s" uri="/struts-tags"%> > ... > > > > > > > Excerpt from Action Class: > public class TagAction extends FlashCardsAppBaseAction implements > ModelDriven { > > Tag tag = new Tag(); > > public Tag getTag() { > return tag; > } > > public void setTag(Tag tag) { > this.tag = tag; > } > public String createTag() { > ... > } > } > > Excerpt from POJO: > public class Tag implements java.io.Serializable { > > > private int id; > private String name; > > public int getId() { > return this.id; > } > > public void setId(int id) { > this.id = id; > } > ... > } > > Excerpt from Struts.xml > class="org.robbins.flashcards.presentation.TagAction" > method="createTag"> > displaytag.tiles > tagform.tiles > > > -- > Regards, > Justin > -- Regards, Justin Robbins 973.479.0448 justinhrobb...@gmail.com Learn more about me by viewing my professional profile on LinkedIn http://www.linkedin.com/in/justinhrobbins View my professional blog http://javadeveloperjournal.blogspot.com/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to Generate Validation.xml file
Good luck on your interview! :-) On Monday, May 2, 2011, Dave Newton wrote: > On Monday, May 2, 2011, vijay333 wrote: >> http://struts.1045723.n5.nabble.com/file/n4364557/untitled.bmp > > Can't actually see the text that causes the error. (Personally I've > never had great luck with Eclipse and XML files over the years.) > >> i have interview on Struts > > Why, I thought you were a beginner? > > Dave > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
help with MethodFailedException in ognl.OgnlRuntime.callAppropriateMethod
Hi folks, I have a working Action and JSP form that I'm using for creating new entities in my very basic Struts 2.2.1.1 app. I'm trying to modify the app to re-use the JSP form with editing of entities. I added a hidden "ID" tag and now I'm getting errors when I submit the form. Can someone please give me some assistance? I've Googled this issue and seen others posting similar errors but I'm not sure how to resolve it. Excerpt from Stack Trace when I submit the form: 2011-05-02 11:09:36,132 3198497 ["http-bio-8080"-exec-23] WARN com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression 'id' with value '[Ljava.lang.String;@100ac03' ognl.MethodFailedException: Method "setId" failed for object org.robbins.flashcards.model.Tag@1b9eb34 [name='null' ] [java.lang.NoSuchMethodException: org.robbins.flashcards.model.Tag.setId([Ljava.lang.String;)] at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285) at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474) Excerpt from JSP: <%@ taglib prefix="s" uri="/struts-tags"%> ... Excerpt from Action Class: public class TagAction extends FlashCardsAppBaseAction implements ModelDriven { Tag tag = new Tag(); public Tag getTag() { return tag; } public void setTag(Tag tag) { this.tag = tag; } public String createTag() { ... } } Excerpt from POJO: public class Tag implements java.io.Serializable { private int id; private String name; public int getId() { return this.id; } public void setId(int id) { this.id = id; } ... } Excerpt from Struts.xml displaytag.tiles tagform.tiles -- Regards, Justin - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to Generate Validation.xml file
On Monday, May 2, 2011, vijay333 wrote: > http://struts.1045723.n5.nabble.com/file/n4364557/untitled.bmp Can't actually see the text that causes the error. (Personally I've never had great luck with Eclipse and XML files over the years.) > i have interview on Struts Why, I thought you were a beginner? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to import existing project
On Monday, May 2, 2011, vijay333 wrote: > how to import existing project into Myeclipes ide.How many ways to import > project and how can import war file project in Myeclipes6.0. For MyEclipse questions you're better off asking on a MyEclipse or Eclipse list/forum, this list is primarily focused on Struts. > after importing the project if any error in project,how can it solved That'd kind of depend on the error. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
how to import existing project
hi how to import existing project into Myeclipes ide.How many ways to import project and how can import war file project in Myeclipes6.0. after importing the project if any error in project,how can it solved please forward all detials please help me Thanks & Regards Vijay -- View this message in context: http://struts.1045723.n5.nabble.com/how-to-import-existing-project-tp4364567p4364567.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
how to Generate Validation.xml file
hii i am Struts beginner, i am using myeclipes6.0 after creating the project ,i added Struts capabilities, all files generated but,VALIDATION.XML file not generated under WEBINF.Then i developed manually but,errors generated in validation.XML file .i.e http://struts.1045723.n5.nabble.com/file/n4364557/untitled.bmp please hele me, i have interview on Struts Thanks & Regards Vijay reddy -- View this message in context: http://struts.1045723.n5.nabble.com/how-to-Generate-Validation-xml-file-tp4364557p4364557.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Multiple controller
Hi My code is as follolws . action org.apache.struts.action.ActionServlet config/ /WEB-INF/conf/struts/struts-config-1.xml action2 org.apache.struts.action.ActionServlet config/ /WEB-INF/conf/struts/struts-config-2.xml action *.do action2 *.au In the controller tag of struts-config 1 and 2 i have put classes say class1 and class2 which extend RequestProcessor. but when *.au request is made it is not getting into class2 instead it is getting into class1 -- View this message in context: http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364494.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 validation on List of String data
> String[] names; >// OR > >ArrayList names; >} >i want to validate RequiredStringValidator validator on these names. I don't think the standard validations deal with arrays. Probably your best bet is to override validate() and validate on your own. See: http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/Validateable.html http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/ValidationAware.html http://struts.apache.org/2.1.6/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html (which implements those interfaces)
Re: Multiple controller
Probably I would use filter-mapping struts /* On 2 May 2011 12:19, Maurizio Cucchiara wrote: > I'm not sure I understand what you exactly mean, but have you tried to > map the url through the web.xml? > for example: > > > struts-1 > *.do > > > > struts-2 > *.au > > > > > On 2 May 2011 11:49, jimjoh...@gmail.com wrote: >> >> Hi >> >> Can anybody give configuration to handle 2 controller? >> >> For the first controller my url-pattern will be *.do and for the second one >> it will be *.au >> >> Can any body help me? >> >> Thanks >> >> -- >> View this message in context: >> http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364290.html >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> > > > > -- > Maurizio Cucchiara > -- Maurizio Cucchiara - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Multiple controller
I'm not sure I understand what you exactly mean, but have you tried to map the url through the web.xml? for example: struts-1 *.do struts-2 *.au On 2 May 2011 11:49, jimjoh...@gmail.com wrote: > > Hi > > Can anybody give configuration to handle 2 controller? > > For the first controller my url-pattern will be *.do and for the second one > it will be *.au > > Can any body help me? > > Thanks > > -- > View this message in context: > http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364290.html > Sent from the Struts - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > -- Maurizio Cucchiara - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Multiple controller
Hi Can anybody give configuration to handle 2 controller? For the first controller my url-pattern will be *.do and for the second one it will be *.au Can any body help me? Thanks -- View this message in context: http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364290.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org