Re: META-INF directory stops Convention plugin working
Hi John, We have fixed several issues that might be related to this, can you try with a version built from svn? Or download the files from here: http://people.apache.org/builds/struts/2.1.8/. That is not a release (yet), but it was built from trunk yesterday. musachy On Wed, Sep 23, 2009 at 8:52 AM, j.ollier wrote: > Hi there > > I'm trying to get started with Struts2 in particular the Convention plugin. > > I've copied the code in the User guide and it works fine but only if I DON'T > have a META-INF directory in my War file, even if that directory is empty. > We are using Maven to build the War so the META-INF directory is always > there. > > I'm using Jetty 6.1.11, Struts2 2.1.6. > > I have no struts.xml file. All I have in web.xml is: > > > struts2 > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecut > eFilter > > > struts2 > /* > > > > The error I get on startup is > > java.lang.Exception: Could not load WEB-INF/classes/john/action/Hello.class > at > com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.jav > a:745) > at > com.opensymphony.xwork2.util.finder.ClassFinder.(ClassFinder.java:148) > at > org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(Pa > ckageBasedActionConfigBuilder.java:295) > > Anyone know what is going on here? > > Thanks in advance > > John > > > > DISCLAIMER: This e-mail is confidential and should not be used by anyone who > is > not the original intended recipient. If you have received this e-mail in error > please inform the sender and delete it from your mailbox or any other storage > mechanism. Neither Macmillan Publishers Limited nor any of its agents accept > liability for any statements made which are clearly the sender's own and not > expressly made on behalf of Macmillan Publishers Limited or one of its agents. > Please note that neither Macmillan Publishers Limited nor any of its agents > accept any responsibility for viruses that may be contained in this e-mail or > its attachments and it is your responsibility to scan the e-mail and > attachments (if any). No contracts may be concluded on behalf of Macmillan > Publishers Limited or its agents by means of e-mail communication. Macmillan > Publishers Limited Registered in England and Wales with registered number > 785998 > Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Question about 'if' tag
I think Pawel omitted something in the original reply. You can't say: That won't work. Instead, you have to say: 2009/9/23 Paweł Wielgus > Hi again, > firstly You should read about OGNL basics because You are using it, > then if You write it works, why?, > because struts is treating it like a regular getter, > so it adds get and makes can to camel case Can and in result it > searches for getCanEditCustomer() method, and it finds it in action. > It is a general shortcut for dealing with fields which has getters and > setters. > > Now when You write struts sees this () > at the end and it searches for canEditCustomer() method and of course > it's not finding it anywhere. > > And last the method should be isCanEditCustomer(), but that is just my > habbit. > > Also keep in mind what Wes was writing about, hidding a link is not > suficient. > > Best greetings, > Paweł Wielgus. > > 2009/9/23 Dennis Atkinson : > > I have gone through Pawel's example and it is not working for me. > > > > Here is the iterator: > > > > > > > > I created three methods in my action class: > > > > public boolean getCanEditCustomer() > > { > >return false ; > > } > > > > public boolean getCanEditCustomer(Integer anInt) > > { > >return false ; > > } > > > > public boolean getCanEditCustomer(Customer aCustomer) > > { > >return false ; > > } > > > > These are dummy methods just to see if everything will work. I set an > Eclipse breakpoint on each return statement. So in theory, Eclipse should > stop on one of the statements whether I pass in nothing, an integer, or a > Customer object. > > > > The results are: > > > > (This stops in the first > method) > > (This never stops) > > (This never stops) > >(This never stops) > > > > So it seems like no parameters are being passed in; in fact when I use > the braces to indicate no parameter, that doesn't work either. > > > > > > > > > > > > > > > > > > From: Wes Wannemacher > > To: Struts Users Mailing List > > Sent: Wednesday, September 23, 2009 4:20:33 PM > > Subject: Re: Question about 'if' tag > > > > In addition to what Pawel is saying, be careful that you also check > > the 'canEditCustomer(target)' call in the target action since there is > > nothing to stop someone from figuring out the URL pattern and editing > > people they weren't intended to edit. > > > > -Wes > > > > 2009/9/23 Paweł Wielgus : > >> Hi Dennis, > >> You are nesting tags, it's not possible/permitted, > >> what You should do is something like: > >> or var="iter"> > >> > >> > >> > >> Which simply is naming your iterator variable to "iter" and use it in if > tag, > >> depending on struts2 version it will be id or var. > >> > >> Best greetings, > >> Paweł Wielgus. > >> > >> > >> 2009/9/23 Dennis Atkinson : > >>> Hi all. > >>> > >>> In my Struts2 application, I have a collection of Customer objects, and > various users have the rights to edit some of them and not others. I have > created a Struts iterator tag, and in the iterator, I put the various > Customer attributes into an HTML table. All this works. > >>> > >>> In one cell of the table, I have the string "Edit", and if it's > clicked, it goes to another Action class to edit that particular Customer > object. All that works too. > >>> > >>> What I want to do is only show the "Edit" string if the user has the > right to edit that Customer. I'm trying to set a " but I am sure I'm not doing it right (because it's not working). > >>> > >>> I am trying: > >>> > >>> > >>> > >>> hoping "property" is the current object in the iteration. But whatever > is happening, this doesn't do what I hope it does. Am I anywhere close to > the right solution here? > >>> > >>> Thanks, > >>> Dennis > >>> > >>> > >>> > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > > > > > -- > > Wes Wannemacher > > > > Head Engineer, WanTii, Inc. > > Need Training? Struts, Spring, Maven, Tomcat... > > Ask me for a quote! > > > > - > > 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: Question about 'if' tag
Hi again, firstly You should read about OGNL basics because You are using it, then if You write it works, why?, because struts is treating it like a regular getter, so it adds get and makes can to camel case Can and in result it searches for getCanEditCustomer() method, and it finds it in action. It is a general shortcut for dealing with fields which has getters and setters. Now when You write struts sees this () at the end and it searches for canEditCustomer() method and of course it's not finding it anywhere. And last the method should be isCanEditCustomer(), but that is just my habbit. Also keep in mind what Wes was writing about, hidding a link is not suficient. Best greetings, Paweł Wielgus. 2009/9/23 Dennis Atkinson : > I have gone through Pawel's example and it is not working for me. > > Here is the iterator: > > > > I created three methods in my action class: > > public boolean getCanEditCustomer() > { > return false ; > } > > public boolean getCanEditCustomer(Integer anInt) > { > return false ; > } > > public boolean getCanEditCustomer(Customer aCustomer) > { > return false ; > } > > These are dummy methods just to see if everything will work. I set an > Eclipse breakpoint on each return statement. So in theory, Eclipse should > stop on one of the statements whether I pass in nothing, an integer, or a > Customer object. > > The results are: > > (This stops in the first method) > (This never stops) > (This never stops) > (This never stops) > > So it seems like no parameters are being passed in; in fact when I use the > braces to indicate no parameter, that doesn't work either. > > > > > > > > > From: Wes Wannemacher > To: Struts Users Mailing List > Sent: Wednesday, September 23, 2009 4:20:33 PM > Subject: Re: Question about 'if' tag > > In addition to what Pawel is saying, be careful that you also check > the 'canEditCustomer(target)' call in the target action since there is > nothing to stop someone from figuring out the URL pattern and editing > people they weren't intended to edit. > > -Wes > > 2009/9/23 Paweł Wielgus : >> Hi Dennis, >> You are nesting tags, it's not possible/permitted, >> what You should do is something like: >> or >> >> >> >> Which simply is naming your iterator variable to "iter" and use it in if tag, >> depending on struts2 version it will be id or var. >> >> Best greetings, >> Paweł Wielgus. >> >> >> 2009/9/23 Dennis Atkinson : >>> Hi all. >>> >>> In my Struts2 application, I have a collection of Customer objects, and >>> various users have the rights to edit some of them and not others. I have >>> created a Struts iterator tag, and in the iterator, I put the various >>> Customer attributes into an HTML table. All this works. >>> >>> In one cell of the table, I have the string "Edit", and if it's clicked, it >>> goes to another Action class to edit that particular Customer object. All >>> that works too. >>> >>> What I want to do is only show the "Edit" string if the user has the right >>> to edit that Customer. I'm trying to set a ">> am sure I'm not doing it right (because it's not working). >>> >>> I am trying: >>> >>> >>> >>> hoping "property" is the current object in the iteration. But whatever is >>> happening, this doesn't do what I hope it does. Am I anywhere close to the >>> right solution here? >>> >>> Thanks, >>> Dennis >>> >>> >>> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > > -- > Wes Wannemacher > > Head Engineer, WanTii, Inc. > Need Training? Struts, Spring, Maven, Tomcat... > Ask me for a quote! > > - > 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: Question about 'if' tag
I have gone through Pawel's example and it is not working for me. Here is the iterator: I created three methods in my action class: public boolean getCanEditCustomer() { return false ; } public boolean getCanEditCustomer(Integer anInt) { return false ; } public boolean getCanEditCustomer(Customer aCustomer) { return false ; } These are dummy methods just to see if everything will work. I set an Eclipse breakpoint on each return statement. So in theory, Eclipse should stop on one of the statements whether I pass in nothing, an integer, or a Customer object. The results are: (This stops in the first method) (This never stops) (This never stops) (This never stops) So it seems like no parameters are being passed in; in fact when I use the braces to indicate no parameter, that doesn't work either. From: Wes Wannemacher To: Struts Users Mailing List Sent: Wednesday, September 23, 2009 4:20:33 PM Subject: Re: Question about 'if' tag In addition to what Pawel is saying, be careful that you also check the 'canEditCustomer(target)' call in the target action since there is nothing to stop someone from figuring out the URL pattern and editing people they weren't intended to edit. -Wes 2009/9/23 Paweł Wielgus : > Hi Dennis, > You are nesting tags, it's not possible/permitted, > what You should do is something like: > or > > > > Which simply is naming your iterator variable to "iter" and use it in if tag, > depending on struts2 version it will be id or var. > > Best greetings, > Paweł Wielgus. > > > 2009/9/23 Dennis Atkinson : >> Hi all. >> >> In my Struts2 application, I have a collection of Customer objects, and >> various users have the rights to edit some of them and not others. I have >> created a Struts iterator tag, and in the iterator, I put the various >> Customer attributes into an HTML table. All this works. >> >> In one cell of the table, I have the string "Edit", and if it's clicked, it >> goes to another Action class to edit that particular Customer object. All >> that works too. >> >> What I want to do is only show the "Edit" string if the user has the right >> to edit that Customer. I'm trying to set a "> sure I'm not doing it right (because it's not working). >> >> I am trying: >> >> >> >> hoping "property" is the current object in the iteration. But whatever is >> happening, this doesn't do what I hope it does. Am I anywhere close to the >> right solution here? >> >> Thanks, >> Dennis >> >> >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Question about 'if' tag
In addition to what Pawel is saying, be careful that you also check the 'canEditCustomer(target)' call in the target action since there is nothing to stop someone from figuring out the URL pattern and editing people they weren't intended to edit. -Wes 2009/9/23 Paweł Wielgus : > Hi Dennis, > You are nesting tags, it's not possible/permitted, > what You should do is something like: > or > > > > Which simply is naming your iterator variable to "iter" and use it in if tag, > depending on struts2 version it will be id or var. > > Best greetings, > Paweł Wielgus. > > > 2009/9/23 Dennis Atkinson : >> Hi all. >> >> In my Struts2 application, I have a collection of Customer objects, and >> various users have the rights to edit some of them and not others. I have >> created a Struts iterator tag, and in the iterator, I put the various >> Customer attributes into an HTML table. All this works. >> >> In one cell of the table, I have the string "Edit", and if it's clicked, it >> goes to another Action class to edit that particular Customer object. All >> that works too. >> >> What I want to do is only show the "Edit" string if the user has the right >> to edit that Customer. I'm trying to set a "> sure I'm not doing it right (because it's not working). >> >> I am trying: >> >> >> >> hoping "property" is the current object in the iteration. But whatever is >> happening, this doesn't do what I hope it does. Am I anywhere close to the >> right solution here? >> >> Thanks, >> Dennis >> >> >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Interceptor IOC with Spring
Martin, Good find, but I am not sure if I understand how that relates to the OP question or musachy's answer nevermind i think you are confused which interceptors we are dealing with if you take a closer look at the original poster's question you'll see that this thread is about struts interceptors (not spring) -Wes On Wed, Sep 23, 2009 at 1:06 PM, Martin Gainty wrote: > > what you said originally about Interceptors being built only with Struts > specific org.apache.struts2.impl.StrutsObjectFactory > (and not spring's StrutsSpringObjectFactory and not > StrutsSpringObjectFactory) is true > > Spring does handle injected interceptors via setInterceptorNames of > ProxyFactoryBean > http://www.docjar.com/docs/api/org/springframework/aop/framework/ProxyFactoryBean.html#setInterceptorNames > > hth > Martin Gainty > __ > Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger > sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung > oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich > dem Austausch von Informationen und entfaltet keine rechtliche > Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen > wir keine Haftung fuer den Inhalt uebernehmen. > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le > destinataire prévu, nous te demandons avec bonté que pour satisfaire informez > l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci > est interdite. Ce message sert à l'information seulement et n'aura pas > n'importe quel effet légalement obligatoire. Étant donné que les email > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter > aucune responsabilité pour le contenu fourni. > -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: How to load a tree dynamically?
Look into "widget" frameworks for client side such as Dojo, DWR, etc. We use Dojo and particularly happy with it. http://dojocampus.org/explorer/#Dijit_Tree Greg -Original Message- From: Tommy Pham [mailto:tommy...@yahoo.com] Sent: Wednesday, September 23, 2009 1:18 PM To: Struts Users Mailing List Subject: Re: How to load a tree dynamically? - Original Message > From: Hanen Ben Rhouma > To: Struts Users Mailing List > Sent: Wednesday, September 23, 2009 3:06:23 AM > Subject: How to load a tree dynamically? > > Morning, > > Is it possible to load a tree dynamically with a jsp in an MVC architecture > (using struts 1.3). Dynamically means I got a perforce depot which I need to > retrieve its children as nodes but progressively (on clicking on any parent > directory it will display its children). > > Till now, I've just found the tree taglib which can make use of a tree > object passed into session, but even with such solution I'm obliged to load > the whole tree at once which makes a lot of times and doesn't take into What you're looking for is 'client side', meaning javascript/AJAX. > consideration the changes happening through that time. > > Could someone suggest me another way to implement such structure? > > > Thanks in advance, > Hanen - 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: Hello Help please with Struts2
Hello Thanks very much to all responses this issue is resolved with this message. Kostya - Original Message - From: "Martin Gainty" To: "Struts Users Mailing List" Sent: Saturday, September 19, 2009 11:53 PM Subject: RE: Hello Help please with Struts2 the struts-tags URL <%@ taglib uri="/struts-tags" prefix="s" %> lookups the uri in *.tld (in this case /WEB-INF/classes/META-INF/struts-tags.tld) 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd";> 2.2.3 1.2 s /struts-tags head org.apache.struts2.views.jsp.ui.HeadTag make sure the accompanying jar containing the classes such as HeadTag are located either on WEB-INF/classes or WEB-INF/lib .\WebappName\WEB-INF\lib\struts2-core-2.1.6.jar Martin __ Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. From: harasev...@yandex.ru To: user@struts.apache.org Subject: Hello Help please with Struts2 Date: Sat, 19 Sep 2009 21:55:59 +0100 Hello When running samples struts 2 Here is exception relative to this taglib in NetBeans7.1: <%@ taglib uri="/struts-tags" prefix="s" %> org.apache.jasper.JasperException: /example/HelloWorld.jsp(2,41) PWC6117: File "/struts-tags" not found at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:73) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:359) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:153) Do not now reason why this error appear , beacause struts2-core-2.0.11.jar is on classpath ? Thanks. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Bing brings you health info from trusted sources. http://www.bing.com/search?q=pet+allergy&form=MHEINA&publ=WLHMTAG&crea=TXT_MHEINA_Health_Health_PetAllergy_1x1 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Question about 'if' tag
Hi Dennis, You are nesting tags, it's not possible/permitted, what You should do is something like: or Which simply is naming your iterator variable to "iter" and use it in if tag, depending on struts2 version it will be id or var. Best greetings, Paweł Wielgus. 2009/9/23 Dennis Atkinson : > Hi all. > > In my Struts2 application, I have a collection of Customer objects, and > various users have the rights to edit some of them and not others. I have > created a Struts iterator tag, and in the iterator, I put the various > Customer attributes into an HTML table. All this works. > > In one cell of the table, I have the string "Edit", and if it's clicked, it > goes to another Action class to edit that particular Customer object. All > that works too. > > What I want to do is only show the "Edit" string if the user has the right to > edit that Customer. I'm trying to set a " sure I'm not doing it right (because it's not working). > > I am trying: > > > > hoping "property" is the current object in the iteration. But whatever is > happening, this doesn't do what I hope it does. Am I anywhere close to the > right solution here? > > Thanks, > Dennis > > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Interceptor IOC with Spring
Doh! Sorry for the goose chase, I'll review my code and post it if I'm still stuck... >-Original Message- >From: Musachy Barroso [mailto:musa...@gmail.com] >Sent: Wednesday, September 23, 2009 1:59 PM >To: Struts Users Mailing List >Subject: Re: Interceptor IOC with Spring > >Meh, it all works. Autorired with/without annotations and @Resource >also works (in interceptors). @OP, something is wrong in your >configuration, show us the code :) > >musachy > >On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso >wrote: >> Chris, if autowiring works then using @Autowire with @Qualifier >> (equivalent to @Resource) should also work, I have to try that. >> >> musachy >> >> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt >wrote: >>> In my struts.xml I have: >>> >>> >>> >>> And at the top of my applicationContext.xml I have: >>> >>> >>> >>> And my Interceptors are getting injected just fine. On another >project, I >>> have autowiring turned off, but then you have to define each >interceptor as >>> a bean in the applicationContext.xml and specifically define the >objects >>> that get injected into it. >>> (*Chris*) >>> >>> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski < >>> list-subscripti...@secmgmt.com> wrote: >>> Correct me if I'm wrong, please, but if I have an interceptor, it >should get injected by spring. I have a bean I'm expecting, the set method written, and the bean >defined in applicationContext. My main struts.xml has: >>> value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> My setter is not getting called, is there anything else I need to >do? M. >- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org >>> >> >> >> >> -- >> "Hey you! Would you help me to carry the stone?" Pink Floyd >> > > > >-- >"Hey you! Would you help me to carry the stone?" Pink Floyd > >- >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
Question about 'if' tag
Hi all. In my Struts2 application, I have a collection of Customer objects, and various users have the rights to edit some of them and not others. I have created a Struts iterator tag, and in the iterator, I put the various Customer attributes into an HTML table. All this works. In one cell of the table, I have the string "Edit", and if it's clicked, it goes to another Action class to edit that particular Customer object. All that works too. What I want to do is only show the "Edit" string if the user has the right to edit that Customer. I'm trying to set a " hoping "property" is the current object in the iteration. But whatever is happening, this doesn't do what I hope it does. Am I anywhere close to the right solution here? Thanks, Dennis
Re: Interceptor IOC with Spring
Meh, it all works. Autorired with/without annotations and @Resource also works (in interceptors). @OP, something is wrong in your configuration, show us the code :) musachy On Wed, Sep 23, 2009 at 10:51 AM, Musachy Barroso wrote: > Chris, if autowiring works then using @Autowire with @Qualifier > (equivalent to @Resource) should also work, I have to try that. > > musachy > > On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt wrote: >> In my struts.xml I have: >> >> >> >> And at the top of my applicationContext.xml I have: >> >> >> >> And my Interceptors are getting injected just fine. On another project, I >> have autowiring turned off, but then you have to define each interceptor as >> a bean in the applicationContext.xml and specifically define the objects >> that get injected into it. >> (*Chris*) >> >> On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski < >> list-subscripti...@secmgmt.com> wrote: >> >>> Correct me if I'm wrong, please, but if I have an interceptor, it should >>> get >>> injected by spring. >>> >>> I have a bean I'm expecting, the set method written, and the bean defined >>> in >>> applicationContext. >>> >>> My main struts.xml has: >>> >>> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> >>> >>> My setter is not getting called, is there anything else I need to do? >>> >>> >>> M. >>> >>> >>> - >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@struts.apache.org >>> >>> >> > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Interceptor IOC with Spring
Chris, if autowiring works then using @Autowire with @Qualifier (equivalent to @Resource) should also work, I have to try that. musachy On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt wrote: > In my struts.xml I have: > > > > And at the top of my applicationContext.xml I have: > > > > And my Interceptors are getting injected just fine. On another project, I > have autowiring turned off, but then you have to define each interceptor as > a bean in the applicationContext.xml and specifically define the objects > that get injected into it. > (*Chris*) > > On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski < > list-subscripti...@secmgmt.com> wrote: > >> Correct me if I'm wrong, please, but if I have an interceptor, it should >> get >> injected by spring. >> >> I have a bean I'm expecting, the set method written, and the bean defined >> in >> applicationContext. >> >> My main struts.xml has: >> >> > value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> >> >> My setter is not getting called, is there anything else I need to do? >> >> >> M. >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Interceptor IOC with Spring
lol On Wed, Sep 23, 2009 at 10:06 AM, Martin Gainty wrote: > > what you said originally about Interceptors being built only with Struts > specific org.apache.struts2.impl.StrutsObjectFactory > (and not spring's StrutsSpringObjectFactory and not > StrutsSpringObjectFactory) is true > > Spring does handle injected interceptors via setInterceptorNames of > ProxyFactoryBean > http://www.docjar.com/docs/api/org/springframework/aop/framework/ProxyFactoryBean.html#setInterceptorNames > > hth > Martin Gainty > __ > Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger > sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung > oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich > dem Austausch von Informationen und entfaltet keine rechtliche > Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen > wir keine Haftung fuer den Inhalt uebernehmen. > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le > destinataire prévu, nous te demandons avec bonté que pour satisfaire informez > l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci > est interdite. Ce message sert à l'information seulement et n'aura pas > n'importe quel effet légalement obligatoire. Étant donné que les email > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter > aucune responsabilité pour le contenu fourni. > > > > >> Date: Wed, 23 Sep 2009 09:23:44 -0700 >> Subject: Re: Interceptor IOC with Spring >> From: musa...@gmail.com >> To: user@struts.apache.org >> >> that makes sense, I use @Resource(name = "mybean") on my setter >> methods, so I guess it is just the annotations the ones that do not >> work. >> >> musachy >> >> On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt wrote: >> > In my struts.xml I have: >> > >> > >> > >> > And at the top of my applicationContext.xml I have: >> > >> > >> > >> > And my Interceptors are getting injected just fine. On another project, I >> > have autowiring turned off, but then you have to define each interceptor as >> > a bean in the applicationContext.xml and specifically define the objects >> > that get injected into it. >> > (*Chris*) >> > >> > On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski < >> > list-subscripti...@secmgmt.com> wrote: >> > >> >> Correct me if I'm wrong, please, but if I have an interceptor, it should >> >> get >> >> injected by spring. >> >> >> >> I have a bean I'm expecting, the set method written, and the bean defined >> >> in >> >> applicationContext. >> >> >> >> My main struts.xml has: >> >> >> >> > >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> >> >> >> >> My setter is not getting called, is there anything else I need to do? >> >> >> >> >> >> M. >> >> >> >> >> >> - >> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >> >> >> > >> >> >> >> -- >> "Hey you! Would you help me to carry the stone?" Pink Floyd >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> > > _ > Hotmail: Free, trusted and rich email service. > http://clk.atdmt.com/GBL/go/171222984/direct/01/ -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Interceptor IOC with Spring
OK, thanks, is there a JIRA for this? I'll be happy to request it as an enhancement... >-Original Message- >From: Musachy Barroso [mailto:musa...@gmail.com] >Sent: Wednesday, September 23, 2009 11:23 AM >To: Struts Users Mailing List >Subject: Re: Interceptor IOC with Spring > >interceptors and results do net get dependencies injected. If you >implement BeanFactoryAware, or ApplicationContextAware it will pass >you the bean factory or the context. I will take a look at this, as it >has been bothering me for a while. > >musachy > >On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski > wrote: >> Correct me if I'm wrong, please, but if I have an interceptor, it >should get >> injected by spring. >> >> I have a bean I'm expecting, the set method written, and the bean >defined in >> applicationContext. >> >> My main struts.xml has: >> >> > value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> >> >> My setter is not getting called, is there anything else I need to do? >> >> >> M. >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > >-- >"Hey you! Would you help me to carry the stone?" Pink Floyd > >- >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: How to load a tree dynamically?
- Original Message > From: Hanen Ben Rhouma > To: Struts Users Mailing List > Sent: Wednesday, September 23, 2009 3:06:23 AM > Subject: How to load a tree dynamically? > > Morning, > > Is it possible to load a tree dynamically with a jsp in an MVC architecture > (using struts 1.3). Dynamically means I got a perforce depot which I need to > retrieve its children as nodes but progressively (on clicking on any parent > directory it will display its children). > > Till now, I've just found the tree taglib which can make use of a tree > object passed into session, but even with such solution I'm obliged to load > the whole tree at once which makes a lot of times and doesn't take into What you're looking for is 'client side', meaning javascript/AJAX. > consideration the changes happening through that time. > > Could someone suggest me another way to implement such structure? > > > Thanks in advance, > Hanen - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Interceptor IOC with Spring
what you said originally about Interceptors being built only with Struts specific org.apache.struts2.impl.StrutsObjectFactory (and not spring's StrutsSpringObjectFactory and not StrutsSpringObjectFactory) is true Spring does handle injected interceptors via setInterceptorNames of ProxyFactoryBean http://www.docjar.com/docs/api/org/springframework/aop/framework/ProxyFactoryBean.html#setInterceptorNames hth Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Wed, 23 Sep 2009 09:23:44 -0700 > Subject: Re: Interceptor IOC with Spring > From: musa...@gmail.com > To: user@struts.apache.org > > that makes sense, I use @Resource(name = "mybean") on my setter > methods, so I guess it is just the annotations the ones that do not > work. > > musachy > > On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt wrote: > > In my struts.xml I have: > > > > > > > > And at the top of my applicationContext.xml I have: > > > > > > > > And my Interceptors are getting injected just fine. On another project, I > > have autowiring turned off, but then you have to define each interceptor as > > a bean in the applicationContext.xml and specifically define the objects > > that get injected into it. > > (*Chris*) > > > > On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski < > > list-subscripti...@secmgmt.com> wrote: > > > >> Correct me if I'm wrong, please, but if I have an interceptor, it should > >> get > >> injected by spring. > >> > >> I have a bean I'm expecting, the set method written, and the bean defined > >> in > >> applicationContext. > >> > >> My main struts.xml has: > >> > >> >> value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> > >> > >> My setter is not getting called, is there anything else I need to do? > >> > >> > >> M. > >> > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _ Hotmail: Free, trusted and rich email service. http://clk.atdmt.com/GBL/go/171222984/direct/01/
Re: Interceptor IOC with Spring
that makes sense, I use @Resource(name = "mybean") on my setter methods, so I guess it is just the annotations the ones that do not work. musachy On Wed, Sep 23, 2009 at 9:18 AM, Chris Pratt wrote: > In my struts.xml I have: > > > > And at the top of my applicationContext.xml I have: > > > > And my Interceptors are getting injected just fine. On another project, I > have autowiring turned off, but then you have to define each interceptor as > a bean in the applicationContext.xml and specifically define the objects > that get injected into it. > (*Chris*) > > On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski < > list-subscripti...@secmgmt.com> wrote: > >> Correct me if I'm wrong, please, but if I have an interceptor, it should >> get >> injected by spring. >> >> I have a bean I'm expecting, the set method written, and the bean defined >> in >> applicationContext. >> >> My main struts.xml has: >> >> > value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> >> >> My setter is not getting called, is there anything else I need to do? >> >> >> M. >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Interceptor IOC with Spring
In my struts.xml I have: And at the top of my applicationContext.xml I have: And my Interceptors are getting injected just fine. On another project, I have autowiring turned off, but then you have to define each interceptor as a bean in the applicationContext.xml and specifically define the objects that get injected into it. (*Chris*) On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski < list-subscripti...@secmgmt.com> wrote: > Correct me if I'm wrong, please, but if I have an interceptor, it should > get > injected by spring. > > I have a bean I'm expecting, the set method written, and the bean defined > in > applicationContext. > > My main struts.xml has: > > value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> > > My setter is not getting called, is there anything else I need to do? > > > M. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
META-INF directory stops Convention plugin working
Hi there I'm trying to get started with Struts2 in particular the Convention plugin. I've copied the code in the User guide and it works fine but only if I DON'T have a META-INF directory in my War file, even if that directory is empty. We are using Maven to build the War so the META-INF directory is always there. I'm using Jetty 6.1.11, Struts2 2.1.6. I have no struts.xml file. All I have in web.xml is: struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecut eFilter struts2 /* The error I get on startup is java.lang.Exception: Could not load WEB-INF/classes/john/action/Hello.class at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.jav a:745) at com.opensymphony.xwork2.util.finder.ClassFinder.(ClassFinder.java:148) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(Pa ckageBasedActionConfigBuilder.java:295) Anyone know what is going on here? Thanks in advance John DISCLAIMER: This e-mail is confidential and should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage mechanism. Neither Macmillan Publishers Limited nor any of its agents accept liability for any statements made which are clearly the sender's own and not expressly made on behalf of Macmillan Publishers Limited or one of its agents. Please note that neither Macmillan Publishers Limited nor any of its agents accept any responsibility for viruses that may be contained in this e-mail or its attachments and it is your responsibility to scan the e-mail and attachments (if any). No contracts may be concluded on behalf of Macmillan Publishers Limited or its agents by means of e-mail communication. Macmillan Publishers Limited Registered in England and Wales with registered number 785998 Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Interceptor IOC with Spring
interceptors and results do net get dependencies injected. If you implement BeanFactoryAware, or ApplicationContextAware it will pass you the bean factory or the context. I will take a look at this, as it has been bothering me for a while. musachy On Wed, Sep 23, 2009 at 7:21 AM, Mike Baranski wrote: > Correct me if I'm wrong, please, but if I have an interceptor, it should get > injected by spring. > > I have a bean I'm expecting, the set method written, and the bean defined in > applicationContext. > > My main struts.xml has: > > value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> > > My setter is not getting called, is there anything else I need to do? > > > M. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
REST: handling array
hi all anyone work with REST, i want to send an object in more complex than just name with value, but in array, the case study is array with id value dan item id, quantity, like purchase order so there is master data and detail data just think sending soap xml data in this case i create a rest client, so the struts2 produce meta data. i use swing as the rich client may be someone can help this question? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Switching Action between different modules in Struts 2.1.x...
Hi Muthu, check how your generated html looks like. I don't know if struts isn't adding namespace if it's not specified. Best greetings, Pawel Wielgus. 2009/9/23, Muthu Velappan : > > Hi, > > I have 3 different modules in my project and added that into struts.xml like > this > > > > > > I got a feedback.jsp page in admin module. When user hit the cancel button > from this form, I want that to submit to home.action available in home > module. Since I don’t have the namespace option in submit button tag, this > is how I added this it in my submit button > >action="/home/HomeL" align="right" theme="simple" /> > > but it is not working. It throws the following exception. Can anyone please > let me know where I’m going wrong… > > Struts Problem Report > Struts has detected an unhandled exception: > > Messages: > · There is no Action mapped for namespace /admin and action name > /home/Home. > > > > Stacktraces > There is no Action mapped for namespace /admin and action name /home/Home. - > [unknown location] > > com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:178) > > > Thanks, > Muthu > > -- > View this message in context: > http://www.nabble.com/Switching-Action-between-different-modules-in-Struts-2.1.x...-tp25531036p25531036.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 > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Interceptor IOC with Spring
Correct me if I'm wrong, please, but if I have an interceptor, it should get injected by spring. I have a bean I'm expecting, the set method written, and the bean defined in applicationContext. My main struts.xml has: My setter is not getting called, is there anything else I need to do? M. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Switching Action between different modules...
One easy fix would be to add another result to your /admin namespace that redirects to /home/Home... i.e. Home /home Then, link your s:submit to 'goHome' Of course, if you want to use this everywhere, define this result as a global-result in your parent package and have the rest of your packages extend it. -Wes On Wed, Sep 23, 2009 at 8:10 AM, Muthu Velappan wrote: > Chris, > > This is the content of my home.xml > > extends="propelj"> > class="com.asp.web.home.HomeAction"> > > /membership/Home.jsp > > > > It's namespace is /home where as admin.xml's namespace will be "/admin" and > that's where feedback.jsp related actions are configured. > > ~Muthu > > -Original Message- > From: musom...@aol.com [mailto:musom...@aol.com] > Sent: Wednesday, September 23, 2009 3:23 PM > To: user@struts.apache.org > Subject: Re: Switching Action between different modules... > > > The name of the xml file is immaterial -- what is the namespace attribute > on the package you defined inside of home.xml? > I would use the config-browser to check that the configuration is what you > intended. > > > > > > Chris > > > > > > > -Original Message- > From: Muthu Velappan > To: user@struts.apache.org > Sent: Wed, Sep 23, 2009 3:10 am > Subject: Switching Action between different modules... > > > > > > > > > > > Hi, > > > > I have 3 different modules in my project and added that into struts.xml like > this > > > > > > > > > > > > > > I got a feedback.jsp page in admin module. When user hit the cancel button > from this form, I want that to submit to home.action available in home > module. Since I don't have the namespace option in submit button tag, this > is how I added this it in my submit button > > > > > action="/home/HomeL" align="right" theme="simple" /> > > > > but it is not working. It throws the following exception. Can anyone please > let me know where I'm going wrong. > > > Struts Problem Report > > > Struts has detected an unhandled exception: > > > Messages: > > * There is no Action mapped for namespace /admin and action name > /home/Home. > > _ > > > Stacktraces > > > There is no Action mapped for namespace /admin and action name /home/Home. - > [unknown location] > > > com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1 > 78) > > > > Thanks, > > Muthu > > > > > > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Switching Action between different modules...
Chris, This is the content of my home.xml /membership/Home.jsp It's namespace is /home where as admin.xml's namespace will be "/admin" and that's where feedback.jsp related actions are configured. ~Muthu -Original Message- From: musom...@aol.com [mailto:musom...@aol.com] Sent: Wednesday, September 23, 2009 3:23 PM To: user@struts.apache.org Subject: Re: Switching Action between different modules... The name of the xml file is immaterial -- what is the namespace attribute on the package you defined inside of home.xml? I would use the config-browser to check that the configuration is what you intended. Chris -Original Message- From: Muthu Velappan To: user@struts.apache.org Sent: Wed, Sep 23, 2009 3:10 am Subject: Switching Action between different modules... Hi, I have 3 different modules in my project and added that into struts.xml like this I got a feedback.jsp page in admin module. When user hit the cancel button from this form, I want that to submit to home.action available in home module. Since I don't have the namespace option in submit button tag, this is how I added this it in my submit button but it is not working. It throws the following exception. Can anyone please let me know where I'm going wrong. Struts Problem Report Struts has detected an unhandled exception: Messages: * There is no Action mapped for namespace /admin and action name /home/Home. _ Stacktraces There is no Action mapped for namespace /admin and action name /home/Home. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1 78) Thanks, Muthu - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 1.3] converter converts but not set property
BeansUtils just call your converter, if your form bean property "warType", will be a 'WarrType' . On Wed, Sep 23, 2009 at 7:16 AM, senderj wrote: > > I wrote a converter to convert a enum for BeanUtils.copyProperties(). I > have > this in my struts config: > > type="org.apache.struts.validator.DynaValidatorForm"> > > > Here is my converters (embedded class in my Action) > >public class MyConverter1 implements Converter { >@Override >public WarrType convert(Class c, Object s) { >Object result = null; >String ss = (String) s; >if (c.getSimpleName().equals("WarrType")) { >System.out.println(ss); >if (ss.equals("NONE")) result = WarrType.NONE; >if (ss.equals("CALL")) result = WarrType.CALL; >if (ss.equals("PUT")) result = WarrType.PUT; >} >return (WarrType) result; >} >} > > and here is the code in my Action: > >MyConverter1 mc1 = new MyConverter1(); >ConvertUtils.register(mc1, WarrType.class); >BeanUtils.copyProperties(stk, form); > > I've ensured both Stk and form have the same name "warType". But the > copyProperties() takes care of all other properties, except the warType! I > have another converter for a date properties coded in similar way and it > works. Only this warType doesn't. I have checked the convert() method in > MyConverter in debug mode and it can convert correctly. But the stk.warType > was not set (although its setWarType() was run with correct parm and > output). > > But if I add this code after the copyProperties() at the above, then it > works >BeanUtils.copyProperty(stk, "warType", > PropertyUtils.getSimpleProperty(form, "warType")); > > Any idea why? > > -- > View this message in context: > http://www.nabble.com/-Struts-1.3--converter-converts-but-not-set-property-tp25531070p25531070.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 > >
[Struts 1.3] converter converts but not set property
I wrote a converter to convert a enum for BeanUtils.copyProperties(). I have this in my struts config: Here is my converters (embedded class in my Action) public class MyConverter1 implements Converter { @Override public WarrType convert(Class c, Object s) { Object result = null; String ss = (String) s; if (c.getSimpleName().equals("WarrType")) { System.out.println(ss); if (ss.equals("NONE")) result = WarrType.NONE; if (ss.equals("CALL")) result = WarrType.CALL; if (ss.equals("PUT")) result = WarrType.PUT; } return (WarrType) result; } } and here is the code in my Action: MyConverter1 mc1 = new MyConverter1(); ConvertUtils.register(mc1, WarrType.class); BeanUtils.copyProperties(stk, form); I've ensured both Stk and form have the same name "warType". But the copyProperties() takes care of all other properties, except the warType! I have another converter for a date properties coded in similar way and it works. Only this warType doesn't. I have checked the convert() method in MyConverter in debug mode and it can convert correctly. But the stk.warType was not set (although its setWarType() was run with correct parm and output). But if I add this code after the copyProperties() at the above, then it works BeanUtils.copyProperty(stk, "warType", PropertyUtils.getSimpleProperty(form, "warType")); Any idea why? -- View this message in context: http://www.nabble.com/-Struts-1.3--converter-converts-but-not-set-property-tp25531070p25531070.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 load a tree dynamically?
Morning, Is it possible to load a tree dynamically with a jsp in an MVC architecture (using struts 1.3). Dynamically means I got a perforce depot which I need to retrieve its children as nodes but progressively (on clicking on any parent directory it will display its children). Till now, I've just found the tree taglib which can make use of a tree object passed into session, but even with such solution I'm obliged to load the whole tree at once which makes a lot of times and doesn't take into consideration the changes happening through that time. Could someone suggest me another way to implement such structure? Thanks in advance, Hanen
Re: Switching Action between different modules...
The name of the xml file is immaterial -- what is the namespace attribute on the package you defined inside of home.xml? I would use the config-browser to check that the configuration is what you intended. Chris -Original Message- From: Muthu Velappan To: user@struts.apache.org Sent: Wed, Sep 23, 2009 3:10 am Subject: Switching Action between different modules... Hi, I have 3 different modules in my project and added that into struts.xml like this I got a feedback.jsp page in admin module. When user hit the cancel button from this form, I want that to submit to home.action available in home module. Since I don't have the namespace option in submit button tag, this is how I added this it in my submit button but it is not working. It throws the following exception. Can anyone please let me know where I'm going wrong. Struts Problem Report Struts has detected an unhandled exception: Messages: * There is no Action mapped for namespace /admin and action name /home/Home. _ Stacktraces There is no Action mapped for namespace /admin and action name /home/Home. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1 78) Thanks, Muthu
Switching Action between different modules in Struts 2.1.x...
Hi, I have 3 different modules in my project and added that into struts.xml like this I got a feedback.jsp page in admin module. When user hit the cancel button from this form, I want that to submit to home.action available in home module. Since I don’t have the namespace option in submit button tag, this is how I added this it in my submit button but it is not working. It throws the following exception. Can anyone please let me know where I’m going wrong… Struts Problem Report Struts has detected an unhandled exception: Messages: · There is no Action mapped for namespace /admin and action name /home/Home. Stacktraces There is no Action mapped for namespace /admin and action name /home/Home. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:178) Thanks, Muthu -- View this message in context: http://www.nabble.com/Switching-Action-between-different-modules-in-Struts-2.1.x...-tp25531036p25531036.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: Problem testing my action when I’ve g ot a springbean inside the validators.xml
bump. -- View this message in context: http://www.nabble.com/Problem-testing-my-action-when-I%E2%80%99ve-got-a-springbean-inside-the-validators.xml-tp24862185p25531029.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
[Struts 1.3] first time use custom converter not working
I have a class Stk with property warType of type enum WarrType public enum WarrType { NONE, CALL, PUT; } I have in my struts config and in my Action MyConverter mc = new MyConverter(); ConvertUtils.register(mc, WarrType.class); PropertyUtils.copyProperties(stk, form); .. and embedded in the Action class public class MyConverter implements Converter { @Override public WarrType convert(Class c, Object s) { WarrType result = null; System.out.println("I am running"); if (s.equals("NONE")) result = WarrType.NONE; return result; The problem is the convert() never executed. the copyProperties failed with "...had String ... expect WarrType...". Any idea why? -- View this message in context: http://www.nabble.com/-Struts-1.3--first-time-use-custom-converter-not-working-tp25531027p25531027.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
Switching Action between different modules...
Hi, I have 3 different modules in my project and added that into struts.xml like this I got a feedback.jsp page in admin module. When user hit the cancel button from this form, I want that to submit to home.action available in home module. Since I don't have the namespace option in submit button tag, this is how I added this it in my submit button but it is not working. It throws the following exception. Can anyone please let me know where I'm going wrong. Struts Problem Report Struts has detected an unhandled exception: Messages: * There is no Action mapped for namespace /admin and action name /home/Home. _ Stacktraces There is no Action mapped for namespace /admin and action name /home/Home. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1 78) Thanks, Muthu