[S2] Struts Interceptor to refresh Spring Security Context
Hi, I am writing an interceptor that will re-populate the spring security context. For example, this will allow me to annotate my ChangePasswordAction with @Refresh, so after invocation, the SecurityContext will also contain the changed password. To do this, my interceptor needs a copy of the UserDetailsService, which is configured in Spring. Is this possible? How does the interceptor object get built? Thanks, Brian Relph -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
[S2] json plugin + junit plugin
Is there a reason the json plugin has a compile-time dependency on the junit plugin? Is it just a test dependency perhaps? I would like to exclude the junit plugin from my webapp, but I don't want to break anything down the line. Brian Relph -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
[S2] xwork + spring-test
Is there a reason xwork has a compile-time dependency on spring-test? Is it just a test dependency perhaps? I would like to exclude spring-test from my webapp, but I don't want to break anything. Brian Relph -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
RE: Problem getting request parameters in HTTP GET in Struts 2
First, the post you referenced had a follow up a few days later, and the custom mapper was not actually needed, there was instead a bug in the oracle app server that was fixed in a later release. Second, let struts handle the type conversion for you. You don't need to convert from a string to an integer, it will be done automatically if the parameter names matches the bean property. Brian Relph -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Tuesday, March 17, 2009 6:05 PM To: Struts Users Mailing List Subject: Re: Problem getting request parameters in HTTP GET in Struts 2 What's the action mapping look like (along with its package definition)? Dave Duan, Bin wrote: We found a post in the mailing list that reported the same problem. Check it out. The final solution of it was that the user had to implement a customized map class, which was pretty nasty. Is this something we have to go through, or is there better solution? Is this a bug in S2? Check it out. http://www.mail-archive.com/user@struts.apache.org/msg64440.html -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, March 17, 2009 5:12 PM To: Struts Users Mailing List Subject: Re: Problem getting request parameters in HTTP GET in Struts 2 Why don't you try the blank application or showcase? if they work, then at least you know it is not some container config, but your app. musachy On Tue, Mar 17, 2009 at 5:06 PM, Duan, Bin bd...@claritas.com wrote: It doesn't work. I still get null for the parameter. Some additional info. The request is actually a StrutsRequestWrapper instance. I did the debug, the whole http content on the server side looks like this. You can see the drProviderId is in the get. GET /providerDetail.action?drProviderId=581 HTTP/1.1T accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/x-silverlight, application/x-silverlight-2-b2, */*6 I called request.getRequestURI(), the result is /providerDetail.action. It missed the parameter section. Another thought where might be the problem? -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, March 17, 2009 4:32 PM To: Struts Users Mailing List Subject: Re: Problem getting request parameters in HTTP GET in Struts 2 can you try the new filters? filter filter-namestruts-prepare/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter/filter-class /filter filter filter-namestruts-execute/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter/filter-class /filter filter-mapping filter-namestruts-prepare/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts-execute/filter-name url-pattern/*/url-pattern /filter-mapping musachy On Tue, Mar 17, 2009 at 4:21 PM, Duan, Bin bd...@claritas.com wrote: Musachy, The web.xml is very simple since we just started this project. Here it is. Please advise: ?xml version = '1.0' encoding = 'windows-1252'? web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; descriptionNew MMS Website/description filter filter-namestruts2/filter-name filter-class org.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping session-config session-timeout240/session-timeout /session-config mime-mapping extensionhtml/extension mime-typetext/html/mime-type /mime-mapping mime-mapping extensiontxt/extension mime-typetext/plain/mime-type /mime-mapping /web-app -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, March 17, 2009 4:17 PM To: Struts Users Mailing List Subject: Re: Problem getting request parameters in HTTP GET in Struts 2 Something is very wrong in your configuration. Can you post your web.xml? musachy On Tue, Mar 17, 2009 at 3:50 PM, Duan, Bin bd...@claritas.com wrote: Thanks for the response. I did that. The request obtained by implementing RequestAware is the same as the one obtained from ServletActionRequest.getRequest(). None of them worked. Actually, I did get the parameter map from the request, and it contained null data. Have you tried the scenario, did it work for your application?
[S2] Param tag with collection value
Hello, I would like to construct an action url with a collection-valued parameter, i.e.: http://host/context/search.action?names=NAME1names=NAME2 Is there an easy way to do this? I was trying: s:url action=startRuleSearch id=search s:param name=names value=names/s:param /s:url where 'names' was a ListString, but this was not working. I also tried an iterator with the url tag, but that resulted in no parameters being set. Brian Relph -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
RE: Incorrect Bean Injected
Did you try setting the value=none? Brian Relph -Original Message- From: Timothy Orme [mailto:to...@genome.med.harvard.edu] Sent: Friday, January 16, 2009 10:41 AM To: Struts Users Mailing List Subject: Re: Incorrect Bean Injected So scratch that, I figured out that Struts is set to autowire by default with the spring plugin. In my struts.xml I have: constant name=struts.objectFactory value=org.apache.struts2.spring.StrutsSpringObjectFactory / constant name=struts.objectFactory.spring.autoWire value=type / And am now autowiring by type instead of name. However, does anyone know how to turn off autowiring altogether? I've seen a feature request for this, but it hasn't been filled yet. Has anyone devised a workaround? Thanks, Tim Orme Timothy Orme wrote: This seems really strange to me, but I don't know the inner workings of struts enough to know if it's expected behavior. I'm using Struts 2.1.2 and spring 2.5.3 I have a 2 service beans that have the same name, but depending on the action, one might be used instead of the other. bean id=hibernateUserService class=hibernate.service.impl.LoginUserServiceImpl /bean bean id=sqlUserService class=sql.service.impl.LoginUserServiceImpl /bean bean id=submitQuoteAction class=action.quotes.SubmitQuoteAction property name=userService ref=hibernateUserService / /bean bean id=registerUserAction class=action.users.RegisterUserAction property name=userService ref=sqlUserService/ /bean So I have 2 beans, each serving a similar purpose, so named the same, but used in different actions. What happens is, at the webapp startup, I see the beans get injected into the actions fine. The types are correct, and the property is set. The server starts without any issues. However, whats strange is that when I try and go to either action I get a null pointer for the userService objects in both actions. I did notice though, that if I name one of the service beans to just userService instead of say, hibernateUserService then one of the actions will work correctly, while the other will fail saying that it cant cast sql.service.impl.LoginUserServiceImpl to hibernate.service.impl.LoginUserServiceImpl. It seems then that Struts is wiring the properties by bean name and overriding the beans that I have specified in my applicationContext. Does anyone know what would cause this or how to work around it? Thanks, Tim Orme - 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 -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[S2] ActionValidatorManager configuration
Hello, I would like to change the ActionValidatorManager that is being used in the ValidationInterceptor. It appears that the DefaultActionValidatorManager gathers all of the Validators and puts them in a list that has a parent-first type ordering, where if you have Animal and Dog extends Animal, the validators for Animal are listed first (and thus executed first). I would like to use a ReverseDefaultActionValidatorManager, where the list of validators has a child-first ordering, so the validators for Dog are executed first. Can someone point me to where this is configured? Brian Relph -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
RE: [S2] Plugin architecture
The source is viewable here: https://studio.atlassian.com/source/viewrep/PLUG/ You must have an account to checkout. Brian Relph -Original Message- From: alvins [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2008 10:38 PM To: user@struts.apache.org Subject: Re: [S2] Plugin architecture Hi Don, Can you point me over to where the Atlassian plugins source is available? Thanks, Alvin Don Brown-5 wrote: FWIW, I'm working with James to port the OSGi parts of the Atlassian Plugins framework over to Apache Archiva, which recently moved to Struts 2. We are planning on releasing that bit as its own project, although the whole Atlassian Plugins framework is also now open source. Don On Wed, Nov 19, 2008 at 11:30 AM, Musachy Barroso [EMAIL PROTECTED] wrote: Any bean registered as com.opensymphony.xwork2.config.PackageProvider (since 2.1 I think) will be loaded and added to the configuration. So the short answers is yes, you should be able to mix regular action definitions with bundled actions. The plugin still needs some love, but it is functional, feedback is apreciated. musachy On Tue, Nov 18, 2008 at 7:08 PM, Wes Wannemacher [EMAIL PROTECTED] wrote: To be honest, I don't know. But, what makes the s2/osgi different from other OSGi integration libraries is that bundles are deployed within the single web-app. This means, you could create one bundle with your base actions and then deploy other bundles without restarting your app. I could be completely off-base, I wasn't involved with writing the plugin, I am just trying to regurgitate memories from the discussion on [EMAIL PROTECTED] Maybe Musachy can chime in. -Wes On Tue, 2008-11-18 at 14:00 -0600, Relph,Brian wrote: That plugin looks promising, the isolated classpaths requirement could be bent ... Does the plugin require that all actions be loaded from bundles? Brian Relph -Original Message- From: Wes Wannemacher [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2008 10:18 AM To: Struts Users Mailing List Subject: Re: [S2] Plugin architecture I am not sure if it does exactly what you want (isolated classpaths), but this might help get you started - http://cwiki.apache.org/S2PLUGINS/osgi-plugin.html Note, this plugin is experimental and hasn't seen updates in a while, but still worthwhile. -Wes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Plugin-architecture-tp20562706p20573638.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [S2] Plugin architecture
Don, is the Archiva port available in anywhere, maybe a sandbox? Brian Relph -Original Message- From: Relph,Brian [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2008 10:20 AM To: Struts Users Mailing List Subject: RE: [S2] Plugin architecture The source is viewable here: https://studio.atlassian.com/source/viewrep/PLUG/ You must have an account to checkout. Brian Relph -Original Message- From: alvins [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2008 10:38 PM To: user@struts.apache.org Subject: Re: [S2] Plugin architecture Hi Don, Can you point me over to where the Atlassian plugins source is available? Thanks, Alvin Don Brown-5 wrote: FWIW, I'm working with James to port the OSGi parts of the Atlassian Plugins framework over to Apache Archiva, which recently moved to Struts 2. We are planning on releasing that bit as its own project, although the whole Atlassian Plugins framework is also now open source. Don On Wed, Nov 19, 2008 at 11:30 AM, Musachy Barroso [EMAIL PROTECTED] wrote: Any bean registered as com.opensymphony.xwork2.config.PackageProvider (since 2.1 I think) will be loaded and added to the configuration. So the short answers is yes, you should be able to mix regular action definitions with bundled actions. The plugin still needs some love, but it is functional, feedback is apreciated. musachy On Tue, Nov 18, 2008 at 7:08 PM, Wes Wannemacher [EMAIL PROTECTED] wrote: To be honest, I don't know. But, what makes the s2/osgi different from other OSGi integration libraries is that bundles are deployed within the single web-app. This means, you could create one bundle with your base actions and then deploy other bundles without restarting your app. I could be completely off-base, I wasn't involved with writing the plugin, I am just trying to regurgitate memories from the discussion on [EMAIL PROTECTED] Maybe Musachy can chime in. -Wes On Tue, 2008-11-18 at 14:00 -0600, Relph,Brian wrote: That plugin looks promising, the isolated classpaths requirement could be bent ... Does the plugin require that all actions be loaded from bundles? Brian Relph -Original Message- From: Wes Wannemacher [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2008 10:18 AM To: Struts Users Mailing List Subject: Re: [S2] Plugin architecture I am not sure if it does exactly what you want (isolated classpaths), but this might help get you started - http://cwiki.apache.org/S2PLUGINS/osgi-plugin.html Note, this plugin is experimental and hasn't seen updates in a while, but still worthwhile. -Wes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Plugin-architecture-tp20562706p20573638.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Plugin architecture
Hello, I am trying to build a struts2 app that has support for plugins - not a struts2-plugin - but more like an additional set of functionality for the app itself. The plugins would be uploadable, need to have an isolated classpath, and contribute both actions and views, and be able to add to existing views. If you are familiar with Hudson, I basically want they same type of functionality. After looking through the hudson code-base though, I still felt lost - especially around the different-classloaders requirement. Does anyone have experience in doing this? Brian Relph | Software Engineer | Cerner Corporation | 816-201-7642 | [EMAIL PROTECTED] | www.cerner.com -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
RE: [S2] Plugin architecture
That plugin looks promising, the isolated classpaths requirement could be bent ... Does the plugin require that all actions be loaded from bundles? Brian Relph -Original Message- From: Wes Wannemacher [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2008 10:18 AM To: Struts Users Mailing List Subject: Re: [S2] Plugin architecture I am not sure if it does exactly what you want (isolated classpaths), but this might help get you started - http://cwiki.apache.org/S2PLUGINS/osgi-plugin.html Note, this plugin is experimental and hasn't seen updates in a while, but still worthwhile. -Wes On Tue, Nov 18, 2008 at 11:10 AM, Relph,Brian [EMAIL PROTECTED] wrote: Hello, I am trying to build a struts2 app that has support for plugins - not a struts2-plugin - but more like an additional set of functionality for the app itself. The plugins would be uploadable, need to have an isolated classpath, and contribute both actions and views, and be able to add to existing views. If you are familiar with Hudson, I basically want they same type of functionality. After looking through the hudson code-base though, I still felt lost - especially around the different-classloaders requirement. Does anyone have experience in doing this? Brian Relph | Software Engineer | Cerner Corporation | 816-201-7642 | [EMAIL PROTECTED] | www.cerner.com -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. -- Wesley Wannemacher President, Head Engineer/Consultant WanTii, Inc. http://www.wantii.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [S2] JSON plugin parser error
Thanks for the pointer, you are right, json does not like objects as keys. I re-worked my data structure, and the serialized response was valid. Brian Relph -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 11, 2008 8:45 PM To: Struts Users Mailing List Subject: Re: [S2] JSON plugin parser error the problem will be when you try to access that map using javascript. On Tue, Nov 11, 2008 at 8:38 PM, Relph,Brian [EMAIL PROTECTED] wrote: I have an object that is related to a set of other objects. I suppose I could make 2 maps both keyed by the same primitive, one for the objects, and one to the related objects. But why? You say it is not a good idea, but my objects all implement hashcode and equals, and outside of trying to transform the structure to json, it works perfectly. Is there some json limitation with having object keys? Looking at the transformer in the plugin, it seems to handle object keys just fine. Brian Relph -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 11, 2008 6:42 PM To: Struts Users Mailing List Subject: Re: [S2] JSON plugin parser error Using objects as keys is probably not a good idea. musachy On Tue, Nov 11, 2008 at 6:25 PM, Relph,Brian [EMAIL PROTECTED] wrote: Hello, I am trying to use the JSON plugin in my struts2 application. I am getting a parser error on the string returned from the server. I think the plugin is having problems converting my Map to JSON. Here is my object that I am trying to convert to JSON: *public** class** RoleDetails** extends* RoleImpl { * private* ListRole directParents; * private* MapRole, SetIdentity transitiveParentsWithSources; * private* ListRole directChildren; * private* MapRole, SetIdentity transitiveChildrenWithSources; * private* ListGroup directGroupChildren; * private* MapGroup, SetIdentity transitiveGroupChildrenWithSources; * private* ListString directUsernames; * private* MapString, SetIdentity transitiveUsernamesWithSources; * private* ListPermission directPermissionParents; * private* MapPermission, SetIdentity transitivePermissionParentsWithSources; I have attached the output from one of my requests, but it is pretty long, here is the portion where the json compiler explodes: json.txt transitiveChildrenWithSources:{},transitiveGroupChildrenWithSourc es :*ERROR HERE*{{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581 , temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser, fk 3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw 01 2795,kchintan,kp014672]}:[{description:Health Management Advisor,groupNames:[hin_wasadmins],name:HHM_Advisor,userna me s:[testuser13,kp016678,hmadvisor1,hmadvisor2_cert,hmadviso r1 _cert,hmadvisor2,hmadvisor3,hmadvsr2,hmadvisor3_cert,hmadv sr 1,hmadvsr3]}]} So it looks like there is either a problem with my map keyed by object, or the transitiveChildrenWithSources map being empty. Any thoughts? *Brian Relph* | Software Engineer | Cerner Corporation | 816-201-7642 | ** [EMAIL PROTECTED] [EMAIL PROTECTED] | ***www.cerner.com*http://www.cerner.com -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] JSON plugin parser error
Hello, I am trying to use the JSON plugin in my struts2 application. I am getting a parser error on the string returned from the server. I think the plugin is having problems converting my Map to JSON. Here is my object that I am trying to convert to JSON: public class RoleDetails extends RoleImpl { private ListRole directParents; private MapRole, SetIdentity transitiveParentsWithSources; private ListRole directChildren; private MapRole, SetIdentity transitiveChildrenWithSources; private ListGroup directGroupChildren; private MapGroup, SetIdentity transitiveGroupChildrenWithSources; private ListString directUsernames; private MapString, SetIdentity transitiveUsernamesWithSources; private ListPermission directPermissionParents; private MapPermission, SetIdentity transitivePermissionParentsWithSources; I have attached the output from one of my requests, but it is pretty long, here is the portion where the json compiler explodes: json.txt transitiveChildrenWithSources:{},transitiveGroupChildrenWithSources:ERROR HERE{{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581,temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser,fk3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw012795,kchintan,kp014672]}:[{description:Health Management Advisor,groupNames:[hin_wasadmins],name:HHM_Advisor,usernames:[testuser13,kp016678,hmadvisor1,hmadvisor2_cert,hmadvisor1_cert,hmadvisor2,hmadvisor3,hmadvsr2,hmadvisor3_cert,hmadvsr1,hmadvsr3]}]} So it looks like there is either a problem with my map keyed by object, or the transitiveChildrenWithSources map being empty. Any thoughts? Brian Relph | Software Engineer | Cerner Corporation | 816-201-7642 | [EMAIL PROTECTED] | www.cerner.com -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. {name:Role_HHM_Advisor,role:{description:Health Management Advisor,directChildren:[],directGroupChildren:[{description:Healthe Consumers,groupNames:[],name:HealthCoaches,usernames:[test_usertool,healthcoach,test_usertool6,test_usertool11]},{description:Health Management Advisor,groupNames:[hin_wasadmins],name:HHM_Advisor,usernames:[testuser13,kp016678,hmadvisor1,hmadvisor2_cert,hmadvisor1_cert,hmadvisor2,hmadvisor3,hmadvsr2,hmadvisor3_cert,hmadvsr1,hmadvsr3]}],directParents:[],directPermissionParents:[{description:null,name:Permission_HHM_AddGoal,namespace:HHM,roleNames:[role_hhm_advisor]}],directUsernames:[],groupNames:[healthcoaches,hhm_advisor],name:Role_HHM_Advisor,namespace:HHM,roleNames:[],transitiveChildrenWithSources:{},transitiveGroupChildrenWithSources:{{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581,temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser,fk3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw012795,kchintan,kp014672]}:[{description:Health Management Advisor,groupNames:[hin_wasadmins],name:HHM_Advisor,usernames:[testuser13,kp016678,hmadvisor1,hmadvisor2_cert,hmadvisor1_cert,hmadvisor2,hmadvisor3,hmadvsr2,hmadvisor3_cert,hmadvsr1,hmadvsr3]}]},transitiveParentsWithSources:{},transitivePermissionParentsWithSources:{},transitiveUsernamesWithSources:{admin_usertool:[{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581,temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser,fk3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw012795,kchintan,kp014672]}],ar016581:[{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581,temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser,fk3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw012795,kchintan,kp014672]}],bgraves:[{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581,temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser,fk3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw012795,kchintan,kp014672]}],bk016677:[{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581,temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser,fk3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw012795,kchintan,kp014672]}],bo017459:[{description:super
RE: [S2] JSON plugin parser error
I have an object that is related to a set of other objects. I suppose I could make 2 maps both keyed by the same primitive, one for the objects, and one to the related objects. But why? You say it is not a good idea, but my objects all implement hashcode and equals, and outside of trying to transform the structure to json, it works perfectly. Is there some json limitation with having object keys? Looking at the transformer in the plugin, it seems to handle object keys just fine. Brian Relph -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 11, 2008 6:42 PM To: Struts Users Mailing List Subject: Re: [S2] JSON plugin parser error Using objects as keys is probably not a good idea. musachy On Tue, Nov 11, 2008 at 6:25 PM, Relph,Brian [EMAIL PROTECTED] wrote: Hello, I am trying to use the JSON plugin in my struts2 application. I am getting a parser error on the string returned from the server. I think the plugin is having problems converting my Map to JSON. Here is my object that I am trying to convert to JSON: *public** class** RoleDetails** extends* RoleImpl { * private* ListRole directParents; * private* MapRole, SetIdentity transitiveParentsWithSources; * private* ListRole directChildren; * private* MapRole, SetIdentity transitiveChildrenWithSources; * private* ListGroup directGroupChildren; * private* MapGroup, SetIdentity transitiveGroupChildrenWithSources; * private* ListString directUsernames; * private* MapString, SetIdentity transitiveUsernamesWithSources; * private* ListPermission directPermissionParents; * private* MapPermission, SetIdentity transitivePermissionParentsWithSources; I have attached the output from one of my requests, but it is pretty long, here is the portion where the json compiler explodes: json.txt transitiveChildrenWithSources:{},transitiveGroupChildrenWithSources :*ERROR HERE*{{description:super users,groupNames:[],name:hin_wasadmins,usernames:[ar016581, temp_wasadmin,admin_usertool,relphie,bgraves,newtestuser,fk 3794,samkarl,test_usertool,kp016678,bo017459,bk016677,rw01 2795,kchintan,kp014672]}:[{description:Health Management Advisor,groupNames:[hin_wasadmins],name:HHM_Advisor,username s:[testuser13,kp016678,hmadvisor1,hmadvisor2_cert,hmadvisor1 _cert,hmadvisor2,hmadvisor3,hmadvsr2,hmadvisor3_cert,hmadvsr 1,hmadvsr3]}]} So it looks like there is either a problem with my map keyed by object, or the transitiveChildrenWithSources map being empty. Any thoughts? *Brian Relph* | Software Engineer | Cerner Corporation | 816-201-7642 | ** [EMAIL PROTECTED] [EMAIL PROTECTED] | ***www.cerner.com*http://www.cerner.com -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Authorization Interceptor
Hello, I have recently integrated my struts2 apps with spring security for authentication. We use an implementation of CAS for single-sign-in/out. I am now looking to add authorization, and I was wondering if anyone had implemented an authorization interceptor with spring-security, and how that turned out. I am looking for both action and method level authorization. Thanks, Brian Relph -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
Struts Authorization Interceptor
Hello, I have recently integrated my struts2 apps with spring security for authentication. We use an implementation CAS for single-sign-in/out. I am now looking to add authorization, and I was wondering if anyone had implemented an authorization interceptor with spring-security, and how that turned out. I am looking for both action and method level authorization. Thanks, Brian Relph -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 2.0 and RAD 7.0
And your web.xml? Brian Relph -Original Message- From: achandra [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 21, 2008 10:07 AM To: user@struts.apache.org Subject: Re: Struts 2.0 and RAD 7.0 Hi Guys, Thank you for such a prompt response. I am uploading two MS word document. One contains the print screen that will show you where I have placed my various files in RAD and other will show you the content of the files I am using. I have tried various combinations in the struts.xml and struts-validation.xml and hopefully using the right jar files. Please let me know what am I doing wrong. I feel like I am just one step away and there is something really small that I am missing or doing wrong. Thank you achandra wrote: I have been trying to working on RAD and Struts 2.0. I have tried every possible thing I could. The very first page works fine, but there after when I click the submit button it brings the URL back with the .action extension and throws an error that message couldn't be found. I am keeping it very simple. Just a hello world example. But it is still not working. I don't think Struts 2.0 should be that complex to adapt. It is very discouraging. I am using online tutorials to use package name, keep the jsp files in the folders etc. I am following guidelines from the tutorials, but it is simply not working. Can somebody help me and let me know what am I doing wrong?? I can show you the directory structure which I am using but seems like it is not even going to the action class. Although when I try to type the action class in struts.xml, it tells me if I am making a typo mistake in describing the action class in struts.xml file but when I run it and try writing a system.out or system.err in the action class or try to set a break point, it doesn't find it.. It is very disappointing. I don't want to go back to struts 1.3 but if it doesn't work then seems like I won't have any other choice. Thank you http://www.nabble.com/file/p17364305/StrutsRADprob.doc StrutsRADprob.doc http://www.nabble.com/file/p17364305/StrutsRADprob1.doc StrutsRADprob1.doc -- View this message in context: http://www.nabble.com/Struts-2.0-and-RAD-7.0-tp17348435p17364305.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HTML renders incompletely
I think you should start with making your markup valid. There is a free service to do so: http://validator.w3.org/ Looking at your html, I can see several problems that can cause missing fragments (especially in ie6): 1) Unclosed tags- link rel='stylesheet' href='css/default.css' - img width=100% src=images/BlueBar_3.gif 2) Duplicate HEAD tags 3) Self-closing script tags - script type=text/javascript src=js/init.js / Brian Relph -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 20, 2008 5:37 AM To: Struts Users Mailing List Subject: Re: HTML renders incompletely 2008/5/20 [EMAIL PROTECTED]: /tbody /table /body /html That's strange, it seems that it is not flushing the content... I think this is a bug, but I cannot guess what the problem is at the moment. Could you open a JIRA ticket, attaching a sample webapp (with source)? https://issues.apache.org/struts/ In the meantime, try to simply add some newlines at the end of the Tiles layout page, probably the last part of the page will show up... Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 2.0 and RAD 7.0
When you say you are using RAD 7.0, do you mean you are running a Struts2 app on a Websphere Application Server? If so, what version of Websphere are you running? Can you also post the stack trace for your error messages, along with your struts.xml Brian Relph -Original Message- From: achandra [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 20, 2008 2:14 PM To: user@struts.apache.org Subject: Struts 2.0 and RAD 7.0 I have been trying to working on RAD and Struts 2.0. I have tried every possible thing I could. The very first page works fine, but there after when I click the submit button it brings the URL back with the .action extension and throws an error that message couldn't be found. I am keeping it very simple. Just a hello world example. But it is still not working. I don't think Struts 2.0 should be that complex to adapt. It is very discouraging. I am using online tutorials to use package name, keep the jsp files in the folders etc. I am following guidelines from the tutorials, but it is simply not working. Can somebody help me and let me know what am I doing wrong?? I can show you the directory structure which I am using but seems like it is not even going to the action class. Although when I try to type the action class in struts.xml, it tells me if I am making a typo mistake in describing the action class in struts.xml file but when I run it and try writing a system.out or system.err in the action class or try to set a break point, it doesn't find it.. It is very disappointing. I don't want to go back to struts 1.3 but if it doesn't work then seems like I won't have any other choice. Thank you -- View this message in context: http://www.nabble.com/Struts-2.0-and-RAD-7.0-tp17348435p17348435.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 2 and Sitemesh
Can you provide your struts.xml? Brian Relph -Original Message- From: Asleson, Ryan [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 1:52 PM To: Struts Users Mailing List Subject: Struts 2 and Sitemesh Hello, I'm new to Struts 2 and have some experience with Sitemesh, but I'm having trouble getting the two to work together. I have defined a decorator like this: decorator name=main page=default.jsp pattern/*.action/pattern /decorator So it should be decorating anything that goes to Struts 2. The default.jsp file has a line that looks like this: page:applyDecorator name=theDecorator page=/include/footer.action http://www.biworldwide.com/info/index.html / When I run the page it fails with this error: javax.servlet.ServletException: java.io.FileNotFoundException: /myapp/include/footer.action I know the decorator default.jsp is being applied because when I remove the page:applyDecorator tag from it there are no errors. If I change the page:applyDecorator's page attribute to be an external website, it works too. So, it looks like it's not getting the call to another internal action. I've triple-check the path and it is correct. In fact, I disabled Sitemesh and went to the /myapp/include/footer.action and it displayed correctly. Here's what's in web.xml: filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping I don't know what else to do. Can anybody figure out what's going on?? Thank you!! -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 2 and Sitemesh
You might try this: page:applyDecorator name=theDecorator s:action name=footer executeResult=true / /page:applyDecorator You can also reference this issue: https://issues.apache.org/struts/browse/WW-2079 Brian Relph -Original Message- From: Relph,Brian [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 2:14 PM To: Struts Users Mailing List Subject: RE: Struts 2 and Sitemesh Can you provide your struts.xml? Brian Relph -Original Message- From: Asleson, Ryan [mailto:[EMAIL PROTECTED] Sent: Friday, May 16, 2008 1:52 PM To: Struts Users Mailing List Subject: Struts 2 and Sitemesh Hello, I'm new to Struts 2 and have some experience with Sitemesh, but I'm having trouble getting the two to work together. I have defined a decorator like this: decorator name=main page=default.jsp pattern/*.action/pattern /decorator So it should be decorating anything that goes to Struts 2. The default.jsp file has a line that looks like this: page:applyDecorator name=theDecorator page=/include/footer.action http://www.biworldwide.com/info/index.html / When I run the page it fails with this error: javax.servlet.ServletException: java.io.FileNotFoundException: /myapp/include/footer.action I know the decorator default.jsp is being applied because when I remove the page:applyDecorator tag from it there are no errors. If I change the page:applyDecorator's page attribute to be an external website, it works too. So, it looks like it's not getting the call to another internal action. I've triple-check the path and it is correct. In fact, I disabled Sitemesh and went to the /myapp/include/footer.action and it displayed correctly. Here's what's in web.xml: filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping I don't know what else to do. Can anybody figure out what's going on?? Thank you!! -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Injecting Spring Services into Struts 2 Actions
The actions are auto-wired by name by default - so if any of its properties match bean-ids in your spring config, and they have setters, then those properties will get set. The part about declaring the dependencies means you disable the auto-wiring, and declare your actions as spring beans. So, instead of this: action name=index class=com.actions.IndexAction result/WEB-INF/view/index.jsp/result /action You would do this: action name=index class=index-action-id result/WEB-INF/view/index.jsp/result /action Along with additional spring config: bean id=index-action-id class=com.actions.IndexAction property name=myDao ref=myDao-id / property name=myMailSender ref=myMailSender-id / /bean Notice this does not actually disable auto-wiring (you would have to set the auto-wire attribute in the spring config, either globally or per-bean), but it does declaratively state what to set on the action as properties. Brian Relph -Original Message- From: Asleson, Ryan [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 8:29 AM To: Struts Users Mailing List Subject: Injecting Spring Services into Struts 2 Actions Hello, I found this guide to injecting Spring beans into Struts 2 Actions: http://cwiki.apache.org/WW/spring.html According to the red box at the bottom of the document, the Struts 2 Action does not need to be registered with Spring. So far so good. However, I'm a little unclear as to how exactly it knows what Spring beans to inject into the Struts 2 Action. Assuming I have a Struts 2 Action that depends on a PersonService, I assume that the Struts 2 Action would have a public mutator for the PersonService like this: public void setPersonService(PersonService service) { this.personService = service; } How does the injection system know that this method should be used for injecting a Spring bean? Imagine that the Struts 2 Action has several set methods, and that there are a number of configured Spring beans. It would take way too long for the injection system to look through every set method on the Action and try to find a matching Spring bean, especially if there are a lot of Spring beans (and there usually are). The document above includes this comment: We strongly recommend that you find declarative ways of letting Spring know what to provide for your actions. But it doesn't give an example of how to let Spring know what to provide to the actions. So, the question is: How do I tell Spring what beans need to be injected into the Action? Thanks -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts.xml
Copy paste error, you need to initialize the Dispatcher with your testConfig map: MapString, String testConfig = new HashMapString, String(); testConfig.put(config, struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml); dispatcher = new Dispatcher(servletContext, testConfig); dispatcher.init(); Dispatcher.setInstance(dispatcher); -Original Message- From: Relph,Brian [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2008 9:48 AM To: Struts Users Mailing List Subject: RE: struts.xml You need to have access to the Dispatcher and the ServletContext in your tests, but you could do something like this for per-unit test configurations: ConfigurationProvider provider = new StrutsXmlConfigurationProvider( struts-test.xml, true, servletContext); dispatcher.getConfigurationManager().addConfigurationProvider(provider); dispatcher.getConfigurationManager().reload(); If you set devMode = true for your tests, you might be able to avoid the reload() call. If you have a just a single struts-test.xml for all of your tests, you could do something like this in your setUp(): MapString, String testConfig = new HashMapString, String(); testConfig.put(config, struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml); dispatcher = new Dispatcher(servletContext, new HashMapString, String()); dispatcher.init(); Dispatcher.setInstance(dispatcher); -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2008 5:00 AM To: Struts Users Mailing List Subject: Re: struts.xml Adam Hardy on 02/04/08 12:23, wrote: Can I have a second struts.xml in my test directory, and if so, how do I configure it? I'm testing some stuff using HttpUnit which launches the whole webapp in my tests. Having a test-only struts.xml will keep the test mappings out of the real webapp, allow me to drop stuff I don't need for the tests, and make the tests faster. From the lack of replies, I assume the answer is 'No, you cannot have an alternative struts.xml'. I was checking the low-down on the wiki, where I found that the struts configuration xml can be in multiple files listed by the property in the struts.properties: ### A list of configuration files automatically loaded by Struts struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml Using this property, I can set up my maven environment to filter struts.properties as a resource and set that property explicitly, so in testing I can have 'struts-test.xml' This works to a limited extent, i.e. one struts.xml for all testing, another for in-container deployment. It's not quite ideal though, as I would prefer to choose the struts.xml on a per-test basis. Does anyone know of something I've missed that allows this? Thanks Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts.xml
You need to have access to the Dispatcher and the ServletContext in your tests, but you could do something like this for per-unit test configurations: ConfigurationProvider provider = new StrutsXmlConfigurationProvider( struts-test.xml, true, servletContext); dispatcher.getConfigurationManager().addConfigurationProvider(provider); dispatcher.getConfigurationManager().reload(); If you set devMode = true for your tests, you might be able to avoid the reload() call. If you have a just a single struts-test.xml for all of your tests, you could do something like this in your setUp(): MapString, String testConfig = new HashMapString, String(); testConfig.put(config, struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml); dispatcher = new Dispatcher(servletContext, new HashMapString, String()); dispatcher.init(); Dispatcher.setInstance(dispatcher); -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2008 5:00 AM To: Struts Users Mailing List Subject: Re: struts.xml Adam Hardy on 02/04/08 12:23, wrote: Can I have a second struts.xml in my test directory, and if so, how do I configure it? I'm testing some stuff using HttpUnit which launches the whole webapp in my tests. Having a test-only struts.xml will keep the test mappings out of the real webapp, allow me to drop stuff I don't need for the tests, and make the tests faster. From the lack of replies, I assume the answer is 'No, you cannot have an alternative struts.xml'. I was checking the low-down on the wiki, where I found that the struts configuration xml can be in multiple files listed by the property in the struts.properties: ### A list of configuration files automatically loaded by Struts struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml Using this property, I can set up my maven environment to filter struts.properties as a resource and set that property explicitly, so in testing I can have 'struts-test.xml' This works to a limited extent, i.e. one struts.xml for all testing, another for in-container deployment. It's not quite ideal though, as I would prefer to choose the struts.xml on a per-test basis. Does anyone know of something I've missed that allows this? Thanks Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: any struts 2 unit testers out there?
I recommend creating an action context. Here is the basic guide I followed to do so: http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/ If you are not using spring or the struts2 spring plugin, you can cut out all the code around the applicationContext. -Original Message- From: paulbrickell [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2008 11:44 AM To: user@struts.apache.org Subject: Re: any struts 2 unit testers out there? I am trying to deal with the same issue. Did you get any resolution? Following on from the reply asking for a stack trace, here is what I am getting... java.lang.NullPointerException at com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:299) at com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:172) at com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:87) at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80) SNIP at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) It is caused by ActionContext.getContext() returning null. Quite obviously I do not have an action context during my unit testing. Now I can certainly use the ActionContext.setContext() in my tests setup method to push one into thread local storage and that works OK. It isn't ideal though because ActionContext is a concrete class and so my choices then become a bit limited. I could create an instance but when I try this I find I have to create a rather large object model to make it actually work. To the point where I despair and give up. Alternatively I could use a mock library (like easy mock). But I am not inclined to include a mocking library that requires byte code rewriting (not even for testing). What I really want to do is inject a text provider into the ActionSupport class. At the top of the ActionSupport class is this... private final transient TextProvider textProvider = new TextProviderFactory().createInstance(getClass(), this); Damn its final and so I cannot inject my own text provider. BUT it uses a factory, thats good. I know I will have a look at the factory I bet I can monkey with that and inject a mock. Nope. It's all instance based. No way I can get in there. And thats that. Now what do I do? I can see two (half) workable solutions. One is to override the the getText method in the action class when I instantiate it during testing. So I end up doing this in all my action unit tests... Action action = new MyAction() { @Override public String getText(String textName) { return mocked; } }; It works, but its cheese. Or two I can add a level of indirection in my action class, like so... String text = MyTextProviderFactory.getInstance(class.name).getText(some.property); Then I can use a delegate to the real text provider during live code and a mock of my own text provider during testing. The question here is, Why for the love of Pete,