Re: Spring Boot + Struts2 Convention Plugin Not Working
Hi I think it's do the fact that the plugin won't scan JARs by default https://struts.apache.org/plugins/convention/#actions-in-jar-files Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ pon., 11 mar 2019 o 18:39 Rubens Gomes napisał(a): > > I using Spring Boot + Struts2, and the convention plugin is not working. > That, is the request URL paths are not being automatically mapped to their > corresponding action classes at all. > > Spring Boot: 1.5.19.RELEASE > Struts2: 2.5.20 > Java VM JDK 1.8 > Maven > > I have the struts2-convention-plugin in my maven POM dependencies. And I > have registered the Struts2 StrutsPrepareAndExecuteFilter as a bean in Spring > Boot, and the filter gets called in the request filter chain. However, it is > not resolving the incoming path to an action class using the convention > plugin. > > Below is a portion of my struts.xml: > > "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" > "http://struts.apache.org/dtds/struts-2.5.dtd;> > > > >value="com.ezlista.web.struts2.action" /> > >value="ezlista-package" /> > >value="com.ezlista.web.struts2" /> >value="/WEB-INF/content/" /> > > > > > > > > > > > > > > > true > ERROR > com.ezlista >name="params.excludeParams">dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*,^_csrf > > > > > > > > . > > > <http://aka.ms/weboutlook> > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Spring Boot + Struts2 Convention Plugin Not Working
I using Spring Boot + Struts2, and the convention plugin is not working. That, is the request URL paths are not being automatically mapped to their corresponding action classes at all. Spring Boot: 1.5.19.RELEASE Struts2: 2.5.20 Java VM JDK 1.8 Maven I have the struts2-convention-plugin in my maven POM dependencies. And I have registered the Struts2 StrutsPrepareAndExecuteFilter as a bean in Spring Boot, and the filter gets called in the request filter chain. However, it is not resolving the incoming path to an action class using the convention plugin. Below is a portion of my struts.xml: http://struts.apache.org/dtds/struts-2.5.dtd;> true ERROR com.ezlista dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*,^_csrf . <http://aka.ms/weboutlook>
Re: Struts mapping failing when using struts2-convention-plugin
[com.tousa.ws.rest.SubdivisionController] in package [com.tousa.ws.rest] DEBUG [main] SEOActionNameBuilder.trace(69) | Changed action name from [SubdivisionController] to [subdivision] DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Got actionName for class [class com.tousa.ws.rest.SubdivisionController] of [subdivision] DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Created package config named [com.tousa.ws.rest#rest-default#] with a namespace [] DEBUG [main] PackageBasedActionConfigBuilder.debug(57) | Creating action config for class [class com.tousa.ws.rest.SubdivisionController], name [subdivision] and package name [com.tousa.ws.rest#rest-default#] in namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Using final calculated namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the Servlet container at [/WEB-INF/content/] with result prefix of [/WEB-INF/content/subdivision] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the class path at [WEB-INF/content/] with a result prefix of [/WEB-INF/content/subdivision] and action name [subdivision] [/code] on any of the above requests, this is the only logged output (to go along with the 404 response): [code] DEBUG [btpool0-2] ConfigurationManager.debug(57) | Checking ConfigurationProviders for reload. DEBUG [btpool0-2] InstantiatingNullHandler.debug(57) | Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@3e48f2], property=struts] WARN [btpool0-2] OgnlValueStack.warn(45) | Could not find property [struts.actionMapping] [/code] which seems totally irrelevant. I am spinning my wheels now and have tried numerous things, but I cannot understand why the supposed action configured at startup does not pick up my URLs. Here are my general configs - I have pared down the configuration to a bare minimum, to match the Showcase app, to no avail (yet): struts.xml [code] constant name=struts.convention.action.suffix value=Controller/ constant name=struts.convention.action.mapAllMatches value=true/ constant name=struts.convention.default.parent.package value=rest-default/ constant name=struts.convention.package.locators value=rest/ [/code] web.xml [code] context-param param-namecontextConfigLocation/param-name param-valueclasspath*:applicationContext*.xml/param-value /context-param !-- Filters -- filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping !-- Listeners -- listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener [/code] pom.xml [code] dependencies !-- Struts 2 -- dependency groupIdorg.apache.struts/groupId artifactIdstruts2-core/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-convention-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-spring-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-rest-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.2.1.ga/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency /dependencies [/code] Any suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e
Re: Struts mapping failing when using struts2-convention-plugin
suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.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 -- 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 -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22380845.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 -- 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 -- View this message in context: http://old.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p30743100.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
Re: Struts mapping failing when using struts2-convention-plugin
[SubdivisionController] to [subdivision] DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Got actionName for class [class com.tousa.ws.rest.SubdivisionController] of [subdivision] DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Created package config named [com.tousa.ws.rest#rest-default#] with a namespace [] DEBUG [main] PackageBasedActionConfigBuilder.debug(57) | Creating action config for class [class com.tousa.ws.rest.SubdivisionController], name [subdivision] and package name [com.tousa.ws.rest#rest-default#] in namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Using final calculated namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the Servlet container at [/WEB-INF/content/] with result prefix of [/WEB-INF/content/subdivision] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the class path at [WEB-INF/content/] with a result prefix of [/WEB-INF/content/subdivision] and action name [subdivision] [/code] on any of the above requests, this is the only logged output (to go along with the 404 response): [code] DEBUG [btpool0-2] ConfigurationManager.debug(57) | Checking ConfigurationProviders for reload. DEBUG [btpool0-2] InstantiatingNullHandler.debug(57) | Entering nullPropertyValue [target=[com.opensymphony.xwork2.DefaultTextProvider@3e48f2], property=struts] WARN [btpool0-2] OgnlValueStack.warn(45) | Could not find property [struts.actionMapping] [/code] which seems totally irrelevant. I am spinning my wheels now and have tried numerous things, but I cannot understand why the supposed action configured at startup does not pick up my URLs. Here are my general configs - I have pared down the configuration to a bare minimum, to match the Showcase app, to no avail (yet): struts.xml [code] constant name=struts.convention.action.suffix value=Controller/ constant name=struts.convention.action.mapAllMatches value=true/ constant name=struts.convention.default.parent.package value=rest-default/ constant name=struts.convention.package.locators value=rest/ [/code] web.xml [code] context-param param-namecontextConfigLocation/param-name param-valueclasspath*:applicationContext*.xml/param-value /context-param !-- Filters -- filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping !-- Listeners -- listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener [/code] pom.xml [code] dependencies !-- Struts 2 -- dependency groupIdorg.apache.struts/groupId artifactIdstruts2-core/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-convention-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-spring-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-rest-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.2.1.ga/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency /dependencies [/code] Any suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.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 -- Hey you! Would you help me to carry
Struts2 2.2.1 exploring annotations with struts2-convention-plugin and struts2-json-plugin
I'm experimenting with Struts2 annotations and have some observations that I'd like clarification on. 1) When using the convention plug-in the book Apache Struts 2 Web application Developement states : quote The plug-in will scan ... in Java packages whose names contain struts, struts2, action, and actions, and whose classname ends in Action. /quote What I've found is that the package must end with one of those names, can I set it to scan for packages actually containing those names? Also in my configuration I can omit the Action suffix. IE: testAction.java can be renamed test.java and everything still works. 2) Well this is not annotation related but when working with the struts2-json-plugin-2.2.1 I find it interesting that it needs getters and setters as demonstrated by: (Take note of the 3 commented lines near the end) / START ***/ package struts2; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; @ParentPackage(json-default) @Result(type = json) @Action(simpleJSON) public class JSONExmapleSimple extends ActionSupport { public String name = ken; public String execute(){ return SUCCESS; } //If uncommented action returns {name:ken} //If commented action returns {} //public String getName() {return name;} } /* END / This is a small detail I don't mind adding getters and setters the IDE makes it easy but I just find it interesting that this isn't consistent with what I'd expect based on the struts OGNL access: s:property value=I_Only_Need_A_Pulic_Field_Now_Which_Is_Cool/ 3) I was wondering if it is possible to apply a struts package automatically based on the java package name. I wonder this because... @ParentPackage(json-default) can be applied to the java source package statement or the Class although when I apply it to the package statement I receive: package annotations should be in file package-info.java from my IDE (Netbeans 6.9.1) so if anyone knows if this is a Java standard great otherwise it's an IDE specific thing and of no further issue here. So simply that I found @ParentPackage which by it's application to a package statement and the earlier statement from 1) about the package name merely needing to contain the string struts2 (among others) I was hoping that the last name in the package could be used to specify the struts xml package to which it belongs? It would be pretty cool! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 2.2.1 exploring annotations with struts2-convention-plugin and struts2-json-plugin
My bad #1 is resolved... I had left my jsp's in /WEB-INF/content not realizing that the java package mypackage.struts2.otherpackage.MyAction Didn't map to: /my but /otherpackage/my The examples I'd seen had a package ending in actions and I'd made an assumption. On Mon, 2010-12-13 at 15:37 -0700, Ken McWilliams wrote: I'm experimenting with Struts2 annotations and have some observations that I'd like clarification on. 1) When using the convention plug-in the book Apache Struts 2 Web application Developement states : quote The plug-in will scan ... in Java packages whose names contain struts, struts2, action, and actions, and whose classname ends in Action. /quote What I've found is that the package must end with one of those names, can I set it to scan for packages actually containing those names? Also in my configuration I can omit the Action suffix. IE: testAction.java can be renamed test.java and everything still works. 2) Well this is not annotation related but when working with the struts2-json-plugin-2.2.1 I find it interesting that it needs getters and setters as demonstrated by: (Take note of the 3 commented lines near the end) / START ***/ package struts2; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; @ParentPackage(json-default) @Result(type = json) @Action(simpleJSON) public class JSONExmapleSimple extends ActionSupport { public String name = ken; public String execute(){ return SUCCESS; } //If uncommented action returns {name:ken} //If commented action returns {} //public String getName() {return name;} } /* END / This is a small detail I don't mind adding getters and setters the IDE makes it easy but I just find it interesting that this isn't consistent with what I'd expect based on the struts OGNL access: s:property value=I_Only_Need_A_Pulic_Field_Now_Which_Is_Cool/ 3) I was wondering if it is possible to apply a struts package automatically based on the java package name. I wonder this because... @ParentPackage(json-default) can be applied to the java source package statement or the Class although when I apply it to the package statement I receive: package annotations should be in file package-info.java from my IDE (Netbeans 6.9.1) so if anyone knows if this is a Java standard great otherwise it's an IDE specific thing and of no further issue here. So simply that I found @ParentPackage which by it's application to a package statement and the earlier statement from 1) about the package name merely needing to contain the string struts2 (among others) I was hoping that the last name in the package could be used to specify the struts xml package to which it belongs? It would be pretty cool! - 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
Struts2 2.2.1 exploring annotations with struts2-convention-plugin and struts2-json-plugin
I'm experimenting with Struts2 annotations and have some observations that I'd like clarification on. 1) When using the convention plug-in the book Apache Struts 2 Web application Developement states : quote The plug-in will scan ... in Java packages whose names contain struts, struts2, action, and actions, and whose classname ends in Action. /quote What I've found is that the package must end with one of those names, can I set it to scan for packages actually containing those names? Also in my configuration I can omit the Action suffix. IE: testAction.java can be renamed test.java and everything still works. 2) Well this is not annotation related but when working with the struts2-json-plugin-2.2.1 I find it interesting that it needs getters and setters as demonstrated by: (Take note of the 3 commented lines near the end) / START ***/ package struts2; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; @ParentPackage(json-default) @Result(type = json) @Action(simpleJSON) public class JSONExmapleSimple extends ActionSupport { public String name = ken; public String execute(){ return SUCCESS; } //If uncommented action returns {name:ken} //If commented action returns {} //public String getName() {return name;} } /* END / This is a small detail I don't mind adding getters and setters the IDE makes it easy but I just find it interesting that this isn't consistent with what I'd expect based on the struts OGNL access: s:property value=I_Only_Need_A_Pulic_Field_Now_Which_Is_Cool/ 3) I was wondering if it is possible to apply a struts package automatically based on the java package name. I wonder this because... @ParentPackage(json-default) can be applied to the java source package statement or the Class although when I apply it to the package statement I receive: package annotations should be in file package-info.java from my IDE (Netbeans 6.9.1) so if anyone knows if this is a Java standard great otherwise it's an IDE specific thing and of no further issue here. So simply that I found @ParentPackage which by it's application to a package statement and the earlier statement from 1) about the package name merely needing to contain the string struts2 (among others) I was hoping that the last name in the package could be used to specify the struts xml package to which it belongs? It would be pretty cool! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2 2.2.1 exploring annotations with struts2-convention-plugin and struts2-json-plugin
I'm experimenting with Struts2 annotations and have some observations that I'd like clarification on. 1) When using the convention plug-in the book Apache Struts 2 Web application Developement states : quote The plug-in will scan ... in Java packages whose names contain struts, struts2, action, and actions, and whose classname ends in Action. /quote What I've found is that the package must end with one of those names, can I set it to scan for packages actually containing those names? Also in my configuration I can omit the Action suffix. IE: testAction.java can be renamed test.java and everything still works. 2) Well this is not annotation related but when working with the struts2-json-plugin-2.2.1 I find it interesting that it needs getters and setters as demonstrated by: (Take note of the 3 commented lines near the end) / START ***/ package struts2; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; @ParentPackage(json-default) @Result(type = json) @Action(simpleJSON) public class JSONExmapleSimple extends ActionSupport { public String name = ken; public String execute(){ return SUCCESS; } //If uncommented action returns {name:ken} //If commented action returns {} //public String getName() {return name;} } /* END / This is a small detail I don't mind adding getters and setters the IDE makes it easy but I just find it interesting that this isn't consistent with what I'd expect based on the struts OGNL access: s:property value=I_Only_Need_A_Pulic_Field_Now_Which_Is_Cool/ 3) I was wondering if it is possible to apply a struts package automatically based on the java package name. I wonder this because... @ParentPackage(json-default) can be applied to the java source package statement or the Class although when I apply it to the package statement I receive: package annotations should be in file package-info.java from my IDE (Netbeans 6.9.1) so if anyone knows if this is a Java standard great otherwise it's an IDE specific thing and of no further issue here. So simply that I found @ParentPackage which by it's application to a package statement and the earlier statement from 1) about the package name merely needing to contain the string struts2 (among others) I was hoping that the last name in the package could be used to specify the struts xml package to which it belongs? It would be pretty cool! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2, convention plugin, websphere 6.1
Everything submit from the client side, are passed as String. So you can't take object instance as your parameter. You need take the ids of these objects as parameter, and load object by the ids by you self. 2010/11/18 Harsh C hchau...@gmail.com: I think that is probably what it was. Basically in my action, I had a list of model objects (modelList) and a model object (selectedModel). I changed the Model type object selectedModel to String type selectedModelId and things work fine now. Now my question is, if I had a checkboxlist backed by a list of Model objects, and upon checking some models, I wanted a list of selectedModel objects, is there a way in struts to do it? Thanks, HC On Wed, Nov 17, 2010 at 11:47 AM, Dave Newton davelnew...@gmail.com wrote: Could also be a type conversion error. On Nov 17, 2010 2:46 PM, Harsh C hchau...@gmail.com wrote: So, result input is some kind of default result that struts sends a user to? Is validation turned on by default, as I did not specify any validation? If so, how can I turn it off? Thanks, HC On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com wrote: Failed validation will send user back to the input result. Dave On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote: Hi, I have an input page which has a checkbox list in a form. Clicking submit takes the user to a 2nd JSP. The problem is that when I don't select a checkbox and click on submit, I get to the output page, of course no value is displayed on the output page though. But if I select a checkbox and click submit, I get an error saying No result defined for action .action.ModelHomeAction and result input I just started with struts and don't really know why it is looking for the result input. I would appreciate any help with this. Relevant code is below. input.jsp s:form method=post action=modelUpload s:checkboxlist name=selectedModel list=modelList listKey=modelId listValue=modelName/ s:submit/s:submit /s:form output.jsp s:property value=selectedModel/ Action private ArrayListModel modelList; private Model selectedModel = new Model(); public ArrayListModel getModelList() { FrameworkHandler handler = new FrameworkHandler(); return handler.getModels(); } public void setModelList(ArrayListModel modelList) { this.modelList = modelList; } public Model getSelectedModel() { return selectedModel; } public void setSelectedModel(Model selectedModel) { this.selectedModel = selectedModel; } public String execute() throws Exception { LOG.debug(Model Home Action); return SUCCESS; } public String upload() throws Exception{ return SUCCESS; } struts.xml action name=modelHome class=.action.ModelHomeAction method=execute result name=success/jsp/input.jsp/result /action action name=modelUpload class=.action.ModelHomeAction method=upload result name=success/jsp/output.jsp/result /action -- *Thanks, Harsh* -- *Thanks, Harsh* - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2, convention plugin, websphere 6.1
Gently bringing this thread back to the topic in the subject line... Does anyone have any ideas about why my WebSphere 6.1 server would be ignoring the convention plugin and not loading any of my struts2 annotations into the context? I did see some references in the websphere patch info to fixing some broken annotation processing with respect to web services, but I'm not using any web services in this particular app (SOAP, etc.). Is this a patch that I need to apply anyway? I hadn't done it yet since it's clear my server IS processing annotations for other things like hibernate and spring (@Autowire, for example, works like a charm). Anyway, I'm stumped. -- Aaron Brown : aa...@thebrownproject.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2, convention plugin, websphere 6.1
I'd backtrack and deploy a simple app with only a single annotated action and the convention plugin and start from there; it's loading the plugin. I'd also check the configuration parameter reference: http://struts.apache.org/2.1.8/docs/convention-plugin.html#ConventionPlugin-Configurationreference I also always put the action classes in a package whose name ends in actions; I vaguely remember having an issue if it was named anything else, but I could be *completely* misremembering that. Dave http://struts.apache.org/2.1.8/docs/convention-plugin.html#ConventionPlugin-Configurationreference On Thu, Nov 18, 2010 at 9:41 AM, Aaron Brown aa...@thebrownproject.comwrote: Gently bringing this thread back to the topic in the subject line... Does anyone have any ideas about why my WebSphere 6.1 server would be ignoring the convention plugin and not loading any of my struts2 annotations into the context? I did see some references in the websphere patch info to fixing some broken annotation processing with respect to web services, but I'm not using any web services in this particular app (SOAP, etc.). Is this a patch that I need to apply anyway? I hadn't done it yet since it's clear my server IS processing annotations for other things like hibernate and spring (@Autowire, for example, works like a charm). Anyway, I'm stumped. -- Aaron Brown : aa...@thebrownproject.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2, convention plugin, websphere 6.1
I've been working on implementing Struts 2.1.8 on WebSphere 6.1 and I'm having trouble with the convention plugin and annotation-based configuration. It appears that none of my struts configs are being scanned and/or processed from the annotations. Here's what I know: 1) Struts2 and WebSphere is an ugly partnership. There are lots of outstanding issues, so I'm wondering if this particular one has been solved and if there's anything I can do. 2) I know WebSphere is scanning other annotations, since my spring/hibernate annotations are working as expected. 3) Config browser tells me that my annotated packages/namespaces have no actions defined. When I load the action configs into .xml files instead, the actions are correctly loaded and working. 4) I tried tossing in some extra struts convention constants just to prod things, but no help: struts.convention.action.disableScanning = false struts.convention.action.packages = com.mycompany.myapp.action 5) This app with all its annotations is working perfectly in Tomcat, just not in WebSphere. 6) I have log4j set to DEBUG and I don't see any information about actions being defined by the convention plugin - it's as if it isn't even executing. I have a workaround - the xml config works - but would prefer to use annotations if I can. Anyone else run into this and solved it? thanks, - Aaron -- Aaron Brown : aa...@thebrownproject.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2, convention plugin, websphere 6.1
Without further information it'll be difficult to help; is devMode turned on? Do you have DEBUG set for *everything*, or just s2 packages, or xwork, or...? It shouldn't matter, but do you have the WebFear filter compatibility flag set (or don't need it due to patch level)? Dave On Wed, Nov 17, 2010 at 11:56 AM, Aaron Brown aa...@thebrownproject.com wrote: I've been working on implementing Struts 2.1.8 on WebSphere 6.1 and I'm having trouble with the convention plugin and annotation-based configuration. It appears that none of my struts configs are being scanned and/or processed from the annotations. Here's what I know: 1) Struts2 and WebSphere is an ugly partnership. There are lots of outstanding issues, so I'm wondering if this particular one has been solved and if there's anything I can do. 2) I know WebSphere is scanning other annotations, since my spring/hibernate annotations are working as expected. 3) Config browser tells me that my annotated packages/namespaces have no actions defined. When I load the action configs into .xml files instead, the actions are correctly loaded and working. 4) I tried tossing in some extra struts convention constants just to prod things, but no help: struts.convention.action.disableScanning = false struts.convention.action.packages = com.mycompany.myapp.action 5) This app with all its annotations is working perfectly in Tomcat, just not in WebSphere. 6) I have log4j set to DEBUG and I don't see any information about actions being defined by the convention plugin - it's as if it isn't even executing. I have a workaround - the xml config works - but would prefer to use annotations if I can. Anyone else run into this and solved it? thanks, - Aaron -- Aaron Brown : aa...@thebrownproject.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2, convention plugin, websphere 6.1
name:java.util.Collection impl:com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor [11/17/10 13:32:57:044 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:ognl.PropertyAccessor name:com.opensymphony.xwork2.ognl.ObjectProxy impl:com.opensymphony.xwork2.ognl.accessor.ObjectProxyPropertyAccessor [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:ognl.MethodAccessor name:java.lang.Object impl:com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:ognl.MethodAccessor name:com.opensymphony.xwork2.util.CompoundRoot impl:com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type: name:default impl:org.apache.struts2.views.jsp.ui.OgnlTool [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:org.apache.struts2.dispatcher.StaticContentLoader name:struts impl:org.apache.struts2.dispatcher.DefaultStaticContentLoader [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:com.opensymphony.xwork2.UnknownHandlerManager name:struts impl:com.opensymphony.xwork2.DefaultUnknownHandlerManager [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:ognl.PropertyAccessor name:java.util.ArrayList impl:com.opensymphony.xwork2.ognl.accessor.XWorkListPropertyAccessor [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:ognl.PropertyAccessor name:java.util.HashSet impl:com.opensymphony.xwork2.ognl.accessor.XWorkCollectionPropertyAccessor [11/17/10 13:32:57:059 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:ognl.PropertyAccessor name:java.util.HashMap impl:com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor [11/17/10 13:32:57:075 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loading action configurations from: struts-plugin.xml [11/17/10 13:32:57:075 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.util.FileManager - Creating revision for URL: wsjar:file:/C:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/nw897628Node01Cell/tsbOne.ear/tsb.war/WEB-INF/lib/struts2-config-browser-plugin-2.1.8.jar!/struts-plugin.xml [11/17/10 13:32:57:090 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.util.FileManager - Creating revision for URL: wsjar:file:/C:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/nw897628Node01Cell/tsbOne.ear/tsb.war/WEB-INF/lib/struts2-convention-plugin-2.1.8.jar!/struts-plugin.xml [11/17/10 13:32:57:106 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.util.FileManager - Creating revision for URL: wsjar:file:/C:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/nw897628Node01Cell/tsbOne.ear/tsb.war/WEB-INF/lib/struts2-spring-plugin-2.1.8.jar!/struts-plugin.xml [11/17/10 13:32:57:122 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded action configuration from: struts-plugin.xml [11/17/10 13:32:57:122 EST] 0019 SystemOut O INFO : com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Parsing configuration file [struts-plugin.xml] [11/17/10 13:32:57:137 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:com.opensymphony.xwork2.UnknownHandler name:convention impl:org.apache.struts2.convention.ConventionUnknownHandler [11/17/10 13:32:57:137 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:org.apache.struts2.convention.ActionConfigBuilder name:convention impl:org.apache.struts2.convention.PackageBasedActionConfigBuilder [11/17/10 13:32:57:137 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:org.apache.struts2.convention.ActionNameBuilder name:convention impl:org.apache.struts2.convention.SEOActionNameBuilder [11/17/10 13:32:57:153 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Loaded type:org.apache.struts2.convention.ResultMapBuilder name:convention impl:org.apache.struts2.convention.DefaultResultMapBuilder [11/17/10 13:32:57:153 EST] 0019 SystemOut O DEBUG: com.opensymphony.xwork2
Re: Struts2, convention plugin, websphere 6.1
Hi, I have an input page which has a checkbox list in a form. Clicking submit takes the user to a 2nd JSP. The problem is that when I don't select a checkbox and click on submit, I get to the output page, of course no value is displayed on the output page though. But if I select a checkbox and click submit, I get an error saying No result defined for action .action.ModelHomeAction and result input I just started with struts and don't really know why it is looking for the result input. I would appreciate any help with this. Relevant code is below. input.jsp s:form method=post action=modelUpload s:checkboxlist name=selectedModel list=modelList listKey=modelId listValue=modelName/ s:submit/s:submit /s:form output.jsp s:property value=selectedModel/ Action private ArrayListModel modelList; private Model selectedModel = new Model(); public ArrayListModel getModelList() { FrameworkHandler handler = new FrameworkHandler(); return handler.getModels(); } public void setModelList(ArrayListModel modelList) { this.modelList = modelList; } public Model getSelectedModel() { return selectedModel; } public void setSelectedModel(Model selectedModel) { this.selectedModel = selectedModel; } public String execute() throws Exception { LOG.debug(Model Home Action); return SUCCESS; } public String upload() throws Exception{ return SUCCESS; } struts.xml action name=modelHome class=.action.ModelHomeAction method=execute result name=success/jsp/input.jsp/result /action action name=modelUpload class=.action.ModelHomeAction method=upload result name=success/jsp/output.jsp/result /action
Re: Struts2, convention plugin, websphere 6.1
Failed validation will send user back to the input result. Dave On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote: Hi, I have an input page which has a checkbox list in a form. Clicking submit takes the user to a 2nd JSP. The problem is that when I don't select a checkbox and click on submit, I get to the output page, of course no value is displayed on the output page though. But if I select a checkbox and click submit, I get an error saying No result defined for action .action.ModelHomeAction and result input I just started with struts and don't really know why it is looking for the result input. I would appreciate any help with this. Relevant code is below. input.jsp s:form method=post action=modelUpload s:checkboxlist name=selectedModel list=modelList listKey=modelId listValue=modelName/ s:submit/s:submit /s:form output.jsp s:property value=selectedModel/ Action private ArrayListModel modelList; private Model selectedModel = new Model(); public ArrayListModel getModelList() { FrameworkHandler handler = new FrameworkHandler(); return handler.getModels(); } public void setModelList(ArrayListModel modelList) { this.modelList = modelList; } public Model getSelectedModel() { return selectedModel; } public void setSelectedModel(Model selectedModel) { this.selectedModel = selectedModel; } public String execute() throws Exception { LOG.debug(Model Home Action); return SUCCESS; } public String upload() throws Exception{ return SUCCESS; } struts.xml action name=modelHome class=.action.ModelHomeAction method=execute result name=success/jsp/input.jsp/result /action action name=modelUpload class=.action.ModelHomeAction method=upload result name=success/jsp/output.jsp/result /action
Re: Struts2, convention plugin, websphere 6.1
So, result input is some kind of default result that struts sends a user to? Is validation turned on by default, as I did not specify any validation? If so, how can I turn it off? Thanks, HC On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com wrote: Failed validation will send user back to the input result. Dave On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote: Hi, I have an input page which has a checkbox list in a form. Clicking submit takes the user to a 2nd JSP. The problem is that when I don't select a checkbox and click on submit, I get to the output page, of course no value is displayed on the output page though. But if I select a checkbox and click submit, I get an error saying No result defined for action .action.ModelHomeAction and result input I just started with struts and don't really know why it is looking for the result input. I would appreciate any help with this. Relevant code is below. input.jsp s:form method=post action=modelUpload s:checkboxlist name=selectedModel list=modelList listKey=modelId listValue=modelName/ s:submit/s:submit /s:form output.jsp s:property value=selectedModel/ Action private ArrayListModel modelList; private Model selectedModel = new Model(); public ArrayListModel getModelList() { FrameworkHandler handler = new FrameworkHandler(); return handler.getModels(); } public void setModelList(ArrayListModel modelList) { this.modelList = modelList; } public Model getSelectedModel() { return selectedModel; } public void setSelectedModel(Model selectedModel) { this.selectedModel = selectedModel; } public String execute() throws Exception { LOG.debug(Model Home Action); return SUCCESS; } public String upload() throws Exception{ return SUCCESS; } struts.xml action name=modelHome class=.action.ModelHomeAction method=execute result name=success/jsp/input.jsp/result /action action name=modelUpload class=.action.ModelHomeAction method=upload result name=success/jsp/output.jsp/result /action -- *Thanks, Harsh*
Re: Struts2, convention plugin, websphere 6.1
Could also be a type conversion error. On Nov 17, 2010 2:46 PM, Harsh C hchau...@gmail.com wrote: So, result input is some kind of default result that struts sends a user to? Is validation turned on by default, as I did not specify any validation? If so, how can I turn it off? Thanks, HC On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com wrote: Failed validation will send user back to the input result. Dave On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote: Hi, I have an input page which has a checkbox list in a form. Clicking submit takes the user to a 2nd JSP. The problem is that when I don't select a checkbox and click on submit, I get to the output page, of course no value is displayed on the output page though. But if I select a checkbox and click submit, I get an error saying No result defined for action .action.ModelHomeAction and result input I just started with struts and don't really know why it is looking for the result input. I would appreciate any help with this. Relevant code is below. input.jsp s:form method=post action=modelUpload s:checkboxlist name=selectedModel list=modelList listKey=modelId listValue=modelName/ s:submit/s:submit /s:form output.jsp s:property value=selectedModel/ Action private ArrayListModel modelList; private Model selectedModel = new Model(); public ArrayListModel getModelList() { FrameworkHandler handler = new FrameworkHandler(); return handler.getModels(); } public void setModelList(ArrayListModel modelList) { this.modelList = modelList; } public Model getSelectedModel() { return selectedModel; } public void setSelectedModel(Model selectedModel) { this.selectedModel = selectedModel; } public String execute() throws Exception { LOG.debug(Model Home Action); return SUCCESS; } public String upload() throws Exception{ return SUCCESS; } struts.xml action name=modelHome class=.action.ModelHomeAction method=execute result name=success/jsp/input.jsp/result /action action name=modelUpload class=.action.ModelHomeAction method=upload result name=success/jsp/output.jsp/result /action -- *Thanks, Harsh*
Re: Struts2, convention plugin, websphere 6.1
I think that is probably what it was. Basically in my action, I had a list of model objects (modelList) and a model object (selectedModel). I changed the Model type object selectedModel to String type selectedModelId and things work fine now. Now my question is, if I had a checkboxlist backed by a list of Model objects, and upon checking some models, I wanted a list of selectedModel objects, is there a way in struts to do it? Thanks, HC On Wed, Nov 17, 2010 at 11:47 AM, Dave Newton davelnew...@gmail.com wrote: Could also be a type conversion error. On Nov 17, 2010 2:46 PM, Harsh C hchau...@gmail.com wrote: So, result input is some kind of default result that struts sends a user to? Is validation turned on by default, as I did not specify any validation? If so, how can I turn it off? Thanks, HC On Wed, Nov 17, 2010 at 11:39 AM, Dave Newton davelnew...@gmail.com wrote: Failed validation will send user back to the input result. Dave On Nov 17, 2010 2:29 PM, Harsh C hchau...@gmail.com wrote: Hi, I have an input page which has a checkbox list in a form. Clicking submit takes the user to a 2nd JSP. The problem is that when I don't select a checkbox and click on submit, I get to the output page, of course no value is displayed on the output page though. But if I select a checkbox and click submit, I get an error saying No result defined for action .action.ModelHomeAction and result input I just started with struts and don't really know why it is looking for the result input. I would appreciate any help with this. Relevant code is below. input.jsp s:form method=post action=modelUpload s:checkboxlist name=selectedModel list=modelList listKey=modelId listValue=modelName/ s:submit/s:submit /s:form output.jsp s:property value=selectedModel/ Action private ArrayListModel modelList; private Model selectedModel = new Model(); public ArrayListModel getModelList() { FrameworkHandler handler = new FrameworkHandler(); return handler.getModels(); } public void setModelList(ArrayListModel modelList) { this.modelList = modelList; } public Model getSelectedModel() { return selectedModel; } public void setSelectedModel(Model selectedModel) { this.selectedModel = selectedModel; } public String execute() throws Exception { LOG.debug(Model Home Action); return SUCCESS; } public String upload() throws Exception{ return SUCCESS; } struts.xml action name=modelHome class=.action.ModelHomeAction method=execute result name=success/jsp/input.jsp/result /action action name=modelUpload class=.action.ModelHomeAction method=upload result name=success/jsp/output.jsp/result /action -- *Thanks, Harsh* -- *Thanks, Harsh*
Re: Struts2, convention plugin, websphere 6.1
I am using Struts 2.2.1 and would like to get some AJAX functionality in my app, specifically, I would like to use Dojo. The Dojo plugin was deprecated for this release, is there some good documentation/tutorials for getting into Struts 2.2.1 with DOJO?
Re: Struts2, convention plugin, websphere 6.1
Please start new threads for new questions. There's a jquery plugin, or you can use any framework in its raw form. The latter is almost always my personal recommendation so the JavaScript can be optimized for the application. Dave On Nov 17, 2010 4:30 PM, Harsh C hchau...@gmail.com wrote:
Re: Struts2 Convention plugin with junit plugin
So, I take it this just isn't going to work then? - Original Message From: Rebecca Case mrc...@yahoo.com To: user@struts.apache.org Sent: Sat, May 15, 2010 10:47:08 AM Subject: Struts2 Convention plugin with junit plugin I'm using Struts 2.8.1 using the convention plugin and attemption to junit test this by utilizing StrutsSpringTestCase. The problem I'm experiencing is that the test throws an exception saying No result defined for action com.becky.action.HowdyFolksAction and result success if I don't use a Results annotation for success instead of just letting it find the correct jsp (which seems to sort of at least partially defeat the purpose). Here's the test: public class HowdyActionTest extends StrutsSpringTestCase { private String result; public void testStufftest() throws Exception{ ActionProxy proxy = getActionProxy(/howdy-folks.cfx); try{ result = proxy.getInvocation().invoke(); } catch(Exception e){ e.printStackTrace(); } HowdyFolksAction action = (HowdyFolksAction) proxy.getAction(); System.out.println(result: + result); } @Override protected String getContextLocations() { return classpath:applicationContext.xml; } } and here's the action //@Results({ //@Result(name=success, location=howdy-folks.jsp) //}) public class HowdyFolksAction extends ActionSupport{ private static final long serialVersionUID = 1L; public String execute(){ System.out.println(I'm here y'all); return SUCCESS; } } Am I missing something or is it just that these plugins don't completely play well together? Also, this is my first time using this list, so I apologize if I'm posting this to the wrong list or am doing something wrong here. - 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
Struts2 Convention plugin with junit plugin
I'm using Struts 2.8.1 using the convention plugin and attemption to junit test this by utilizing StrutsSpringTestCase. The problem I'm experiencing is that the test throws an exception saying No result defined for action com.becky.action.HowdyFolksAction and result success if I don't use a Results annotation for success instead of just letting it find the correct jsp (which seems to sort of at least partially defeat the purpose). Here's the test: public class HowdyActionTest extends StrutsSpringTestCase { private String result; public void testStufftest() throws Exception{ ActionProxy proxy = getActionProxy(/howdy-folks.cfx); try{ result = proxy.getInvocation().invoke(); } catch(Exception e){ e.printStackTrace(); } HowdyFolksAction action = (HowdyFolksAction) proxy.getAction(); System.out.println(result: + result); } @Override protected String getContextLocations() { return classpath:applicationContext.xml; } } and here's the action //@Results({ //@Result(name=success, location=howdy-folks.jsp) //}) public class HowdyFolksAction extends ActionSupport{ private static final long serialVersionUID = 1L; public String execute(){ System.out.println(I'm here y'all); return SUCCESS; } } Am I missing something or is it just that these plugins don't completely play well together? Also, this is my first time using this list, so I apologize if I'm posting this to the wrong list or am doing something wrong here. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: spring, struts2, convention plugin, how to wire an action class
BeanNameAware Interface to be implemented by beans that want to be aware of their bean name in a bean factory. Note that it is not usually recommended that an object depend on its bean name, as this represents a potentially brittle dependence on external configuration, as well as a possibly unnecessary dependence on a Spring API //where does your Bean class MyService implement BeanNameAware? public interface BeanFactory The root interface for accessing a Spring bean container. This is the basic client view of a bean container; further interfaces such as ListableBeanFactory and ConfigurableBeanFactory are available for specific purposes. This interface is implemented by objects that hold a number of bean definitions, each uniquely identified by a String name. Depending on the bean definition, the factory will return either an independent instance of a contained object (the Prototype design pattern), or a single shared instance (a superior alternative to the Singleton design pattern, in which the instance is a singleton in the scope of the factory). Which type of instance will be returned depends on the bean factory configuration: the API is the same. Since Spring 2.0, further scopes are available depending on the concrete application context (e.g. request and session scopes in a web environment). //where does you Bean class implment BeanFactory? //applicationContext.xml bean id=myAction class=com.vang.jake.web.actions.MyAction scope=singleton property name=verbose value=${verbose}/ property name=message value=${message}/ property name=myService ref=myService/ /bean package com.vang.jake.services; public class MyService { private boolean verbose = false; private String message = default; public boolean isVerbose() { return verbose; } public void setVerbose(boolean verbose) { this.verbose = verbose; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } ? 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: Thu, 13 May 2010 20:18:34 -0400 Subject: Re: spring, struts2, convention plugin, how to wire an action class From: vangj...@googlemail.com To: user@struts.apache.org roger, thanks for the steps. i went through each of those steps and made sure my settings/configurations complied. however, i still cannot initialize Action classes using Spring. as an illustration of the problem i am facing, i have created an example that you may download and verify for yourself that this does not work. http://www.box.net/shared/iycamr9uo6 this will download a zip file with an Eclipse project; unzip it. if you have Ant, you simply type in ant war and the war file will be created. if you have Tomcat, then drop the war file into the webapps directory (assuming you have Tomcat 6.0). if you go to http://localhost:8080/myapp/, you will see four lines displayed. String from Action: default boolean from Action: false String from Service: overwritten boolean from Service: true The first and second lines confirm that the String and boolean values are not injected into the Action class. The third and fourth lines confirm that the String and boolean values are injected into the service class. thanks. On Thu, May 13, 2010 at 9:32 AM, RogerV roger.var...@googlemail.com wrote: Jake Vang wrote: If you want Spring to create your action class (as opposed to Struts creating them) then you need to define your action in the applicationContext.xml file. how do you do that? here's a couple of ways i have tried that do NOT work. 1) Add constant name=struts.objectFactory value=org.apache.struts2.spring.StrutsSpringObjectFactory / to your struts.xml file. 2) Add listener listener
spring, struts2, convention plugin, how to wire an action class
i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; @Action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html headtitleTest Spring Wiring/title/head body s:property value=message/ /body /html My web.xml is setup according to http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. My spring XML file (/webapp/WEB-INF/applicationContext.xml) is defined as following. ... bean id=placeholderConfig class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer property name=location value=WEB-INF/applicationContext.properties/ /bean ... bean name=/spring-wiring class=com.me.actions.SpringWiringAction property name=message value=${message}/ /bean My /webapp/WEB-INF/applicationContext.properties file then has this content. message=dependency inject success when i start up tomcat 6, everything starts up correctly and there are no complaints. however, when i go to http://localhost/webapp/spring-wiring, the message that gets displayed is no dependency injection. is there something that i am missing using spring + struts2 (with the convention plugin) to use DI on Actions? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: spring, struts2, convention plugin, how to wire an action class
Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; @Action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html headtitleTest Spring Wiring/title/head body s:property value=message/ /body /html My web.xml is setup according to http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. My spring XML file (/webapp/WEB-INF/applicationContext.xml) is defined as following. ... bean id=placeholderConfig class=org.springframework.beans.factory.config.PropertyPlaceholderConfi gurer property name=location value=WEB-INF/applicationContext.properties/ /bean ... bean name=/spring-wiring class=com.me.actions.SpringWiringAction property name=message value=${message}/ /bean My /webapp/WEB-INF/applicationContext.properties file then has this content. message=dependency inject success when i start up tomcat 6, everything starts up correctly and there are no complaints. however, when i go to http://localhost/webapp/spring-wiring, the message that gets displayed is no dependency injection. is there something that i am missing using spring + struts2 (with the convention plugin) to use DI on Actions? - 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: spring, struts2, convention plugin, how to wire an action class
well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; @Action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html headtitleTest Spring Wiring/title/head body s:property value=message/ /body /html My web.xml is setup according to http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. My spring XML file (/webapp/WEB-INF/applicationContext.xml) is defined as following. ... bean id=placeholderConfig class=org.springframework.beans.factory.config.PropertyPlaceholderConfi gurer property name=location value=WEB-INF/applicationContext.properties/ /bean ... bean name=/spring-wiring class=com.me.actions.SpringWiringAction property name=message value=${message}/ /bean My /webapp/WEB-INF/applicationContext.properties file then has this content. message=dependency inject success when i start up tomcat 6, everything starts up correctly and there are no complaints. however, when i go to http://localhost/webapp/spring-wiring, the message that gets displayed is no dependency injection. is there something that i am missing using spring + struts2 (with the convention plugin) to use DI on Actions? - 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 - To unsubscribe, e-mail: user-unsubscr
RE: spring, struts2, convention plugin, how to wire an action class
Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; @Action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html headtitleTest Spring Wiring/title/head body s:property value=message/ /body /html My web.xml is setup according to http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. My spring XML file (/webapp/WEB-INF/applicationContext.xml) is defined as following. ... bean id=placeholderConfig class=org.springframework.beans.factory.config.PropertyPlaceholderConfi gurer property name=location value=WEB-INF/applicationContext.properties/ /bean ... bean name=/spring-wiring class=com.me.actions.SpringWiringAction property name=message value=${message}/ /bean My /webapp/WEB-INF/applicationContext.properties file then has this content. message=dependency inject success when i start up tomcat 6, everything starts up correctly and there are no complaints. however, when i go to http://localhost/webapp/spring-wiring, the message that gets displayed is no dependency injection. is there something that i am missing using spring + struts2 (with the convention plugin) to use DI on Actions? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
Re: spring, struts2, convention plugin, how to wire an action class
by the way, which package is the @Autowired annotation in? using eclipse and code assist, i can't get it to show up. is it in some other jar file (it's not in the spring-core-x.jar)? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html headtitleTest Spring Wiring/title/head body s:property value=message/ /body /html My web.xml is setup according to http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. My spring XML file (/webapp/WEB-INF/applicationContext.xml) is defined as following. ... bean id=placeholderConfig class=org.springframework.beans.factory.config.PropertyPlaceholderConfi gurer property name=location value=WEB-INF/applicationContext.properties/ /bean ... bean name=/spring-wiring class=com.me.actions.SpringWiringAction property name=message value=${message}/ /bean My /webapp/WEB-INF/applicationContext.properties file then has this content. message=dependency inject success when i start up tomcat 6, everything starts up correctly and there are no complaints. however, when i go to http://localhost/webapp/spring-wiring, the message that gets displayed is no dependency injection. is there something that i am missing using spring + struts2 (with the convention plugin) to use DI on Actions? - 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: spring, struts2, convention plugin, how to wire an action class
doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html headtitleTest Spring Wiring/title/head body s:property value=message/ /body /html My web.xml is setup according to http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. My spring XML file (/webapp/WEB-INF/applicationContext.xml) is defined as following. ... bean id=placeholderConfig class=org.springframework.beans.factory.config.PropertyPlaceholderConfi gurer property name=location value=WEB-INF/applicationContext.properties/ /bean ... bean name=/spring-wiring class=com.me.actions.SpringWiringAction property name=message value=${message}/ /bean My /webapp/WEB-INF/applicationContext.properties file then has this content. message=dependency inject success when i start up tomcat 6, everything starts up correctly and there are no complaints. however, when i go to http://localhost/webapp/spring-wiring, the message that gets displayed is no dependency injection. is there something that i am missing using spring + struts2 (with the convention plugin
RE: spring, struts2, convention plugin, how to wire an action class
Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html headtitleTest Spring Wiring/title/head body s:property value=message/ /body /html My web.xml is setup according to http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html. My spring XML file (/webapp/WEB-INF/applicationContext.xml) is defined as following. ... bean id=placeholderConfig class=org.springframework.beans.factory.config.PropertyPlaceholderConfi gurer property name=location value=WEB-INF/applicationContext.properties/ /bean ... bean name=/spring-wiring class=com.me.actions.SpringWiringAction property name=message value=${message}/ /bean My /webapp/WEB-INF/applicationContext.properties file then has this content. message
Re: spring, struts2, convention plugin, how to wire an action class
thanks. i won't go that route. i noticed your example (in the first response) and i realized that i may trying to push some business logic into the Action class. and, i don't think that's too good of a practice. i simply revised my Service class to hold these values (booleans, String, int, etc...) and now the problem goes away. it's a workaround. if anyone is reading this post and knows how to use struts2 (w/ convention plugin) + spring to construct Action classes, please let me know. the examples i've seen are only with struts1 (and though not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cook james.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } My view or the JSP page corresponding to the Action is: /webapp/WEB-INF/content/spring-wiring-success.jsp. %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %...@taglib uri=/struts-tags prefix=s % html
RE: spring, struts2, convention plugin, how to wire an action class
Oh, did you want your action as a spring managed bean? Ah I think i massively miss read you. You want to inject predefined values etc? -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:38 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class thanks. i won't go that route. i noticed your example (in the first response) and i realized that i may trying to push some business logic into the Action class. and, i don't think that's too good of a practice. i simply revised my Service class to hold these values (booleans, String, int, etc...) and now the problem goes away. it's a workaround. if anyone is reading this post and knows how to use struts2 (w/ convention plugin) + spring to construct Action classes, please let me know. the examples i've seen are only with struts1 (and though not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cook james.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action(value=/spring-wiring) public String springWiring() { return SUCCESS; } public String getMessage
Re: spring, struts2, convention plugin, how to wire an action class
yes. precisely. On Thu, May 13, 2010 at 6:41 AM, James Cook james.c...@wecomm.com wrote: Oh, did you want your action as a spring managed bean? Ah I think i massively miss read you. You want to inject predefined values etc? -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:38 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class thanks. i won't go that route. i noticed your example (in the first response) and i realized that i may trying to push some business logic into the Action class. and, i don't think that's too good of a practice. i simply revised my Service class to hold these values (booleans, String, int, etc...) and now the problem goes away. it's a workaround. if anyone is reading this post and knows how to use struts2 (w/ convention plugin) + spring to construct Action classes, please let me know. the examples i've seen are only with struts1 (and though not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cook james.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI on Action classes. the convention plugin makes life simpler (no XML), but also, partially because of little documentation, makes it uneasy to do certain things. i wonder if this is part of the reason why DI on Action classes using spring + struts is not obvious for me. Here's a simple code. This is my action class. public class SpringWiringAction extends ActionSupport { private String message = no dependency injection; �...@action
RE: spring, struts2, convention plugin, how to wire an action class
Ahh hmm. You can use the autowired, You just have to declare you stuff in the spring xml. E.g. bean id=myJDBCString class=java.lang.String I think you can also use the @Resource anno as well. Can't think off the top of my head. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:44 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class yes. precisely. On Thu, May 13, 2010 at 6:41 AM, James Cook james.c...@wecomm.com wrote: Oh, did you want your action as a spring managed bean? Ah I think i massively miss read you. You want to inject predefined values etc? -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:38 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class thanks. i won't go that route. i noticed your example (in the first response) and i realized that i may trying to push some business logic into the Action class. and, i don't think that's too good of a practice. i simply revised my Service class to hold these values (booleans, String, int, etc...) and now the problem goes away. it's a workaround. if anyone is reading this post and knows how to use struts2 (w/ convention plugin) + spring to construct Action classes, please let me know. the examples i've seen are only with struts1 (and though not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cook james.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2 + convention plugin with spring for DI on my Action classes? i have searched the internet but only seen examples using struts 1 + spring for DI
RE: spring, struts2, convention plugin, how to wire an action class
James Cook-13 wrote: Oh, did you want your action as a spring managed bean? Ah I think i massively miss read you. You want to inject predefined values etc? If you want Spring to create your action class (as opposed to Struts creating them) then you need to define your action in the applicationContext.xml file. Regards -- View this message in context: http://old.nabble.com/spring%2C-struts2%2C-convention-plugin%2C-how-to-%22wire%22-an-action-class-tp28545412p28546598.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: spring, struts2, convention plugin, how to wire an action class
If you want Spring to create your action class (as opposed to Struts creating them) then you need to define your action in the applicationContext.xml file. how do you do that? here's a couple of ways i have tried that do NOT work. 1. (normal, naive way that works for defining services) bean id=action class=com.services.MyAction property name=propertyA value=${propertyA}/ /bean 2. (in this case, we do not use the id attribute, but the name attribute) bean name=/action class=com.services.MyAction property name=propertyA value=${propertyA}/ /bean i've also tried configuring struts.properties to have the ObjectFactory use spring and this does not help. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: spring, struts2, convention plugin, how to wire an action class
thanks. example please? (when you have time). On Thu, May 13, 2010 at 6:52 AM, James Cook james.c...@wecomm.com wrote: Ahh hmm. You can use the autowired, You just have to declare you stuff in the spring xml. E.g. bean id=myJDBCString class=java.lang.String I think you can also use the @Resource anno as well. Can't think off the top of my head. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:44 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class yes. precisely. On Thu, May 13, 2010 at 6:41 AM, James Cook james.c...@wecomm.com wrote: Oh, did you want your action as a spring managed bean? Ah I think i massively miss read you. You want to inject predefined values etc? -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:38 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class thanks. i won't go that route. i noticed your example (in the first response) and i realized that i may trying to push some business logic into the Action class. and, i don't think that's too good of a practice. i simply revised my Service class to hold these values (booleans, String, int, etc...) and now the problem goes away. it's a workaround. if anyone is reading this post and knows how to use struts2 (w/ convention plugin) + spring to construct Action classes, please let me know. the examples i've seen are only with struts1 (and though not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cook james.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 10:23 To: user@struts.apache.org Subject: spring, struts2, convention plugin, how to wire an action class i am using struts 2.1.8.1 and the convention plugin. i am also using spring for dependency injections (DI). my question is if it is possible to to use struts2
Re: spring, struts2, convention plugin, how to wire an action class
Jake, the short answer to your problem is : use the struts-spring plugin ( http://struts.apache.org/2.1.8.1/docs/spring-plugin.html ). Include the jar for that plugin in your classpath, and Struts 2 will use Spring to manage the Action lifecycle, meaning you can inject anything the way you are describing it above (including String, etc...) Denis. Le 2010-05-13 08:09, Jake Vang a écrit : thanks. example please? (when you have time). On Thu, May 13, 2010 at 6:52 AM, James Cookjames.c...@wecomm.com wrote: Ahh hmm. You can use the autowired, You just have to declare you stuff in the spring xml. E.g. bean id=myJDBCString class=java.lang.String I think you can also use the @Resource anno as well. Can't think off the top of my head. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:44 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class yes. precisely. On Thu, May 13, 2010 at 6:41 AM, James Cookjames.c...@wecomm.com wrote: Oh, did you want your action as a spring managed bean? Ah I think i massively miss read you. You want to inject predefined values etc? -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:38 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class thanks. i won't go that route. i noticed your example (in the first response) and i realized that i may trying to push some business logic into the Action class. and, i don't think that's too good of a practice. i simply revised my Service class to hold these values (booleans, String, int, etc...) and now the problem goes away. it's a workaround. if anyone is reading this post and knows how to use struts2 (w/ convention plugin) + spring to construct Action classes, please let me know. the examples i've seen are only with struts1 (and though not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cookjames.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cookjames.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; @Action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers me is that it is not obvious at the moment how to simply inject strings or booleans into the Action class. it should be just as simple. upon analyzing what i am doing, and in light of what you said, perhaps i am trying to push some logic into the Action class that shouldn't be there. perhaps i should push the logic to a service class instead. in this case, this problem goes away. BUT, the question remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cookjames.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if that alters the way Struts2/Spring does it. But it does make it a bit clearer to read. -Original Message- From
Re: spring, struts2, convention plugin, how to wire an action class
yes, i read the documentation for that before posting here too. it says to simply drop in the struts2-spring-plugin-version.jar. i already have that in /WEB-INF/lib. however, towards the end of the document, they are referencing how to initialize Actions from spring using struts.xml and applicationContext.xml. since i am using Annotations and the conventions plugin, i don't think this is what i am looking for. currently, my struts.xml file is 3 lines only! (minus the DOCTYPE lines). there are little but significant differences in how a struts2 based application behaves using the convention plugin (as opposed to using the traditional struts.xml file). i am committed to using the convention plugin + annotations and to avoid as much as possible configurations in struts.xml. if there is an example of how to get all this working (struts2 + convention + annotations + spring), i would be most pleased. thanks. On Thu, May 13, 2010 at 8:24 AM, Denis Cabasson denis.cabas...@gmail.com wrote: Jake, the short answer to your problem is : use the struts-spring plugin ( http://struts.apache.org/2.1.8.1/docs/spring-plugin.html ). Include the jar for that plugin in your classpath, and Struts 2 will use Spring to manage the Action lifecycle, meaning you can inject anything the way you are describing it above (including String, etc...) Denis. Le 2010-05-13 08:09, Jake Vang a écrit : thanks. example please? (when you have time). On Thu, May 13, 2010 at 6:52 AM, James Cookjames.c...@wecomm.com wrote: Ahh hmm. You can use the autowired, You just have to declare you stuff in the spring xml. E.g. bean id=myJDBCString class=java.lang.String I think you can also use the @Resource anno as well. Can't think off the top of my head. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:44 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class yes. precisely. On Thu, May 13, 2010 at 6:41 AM, James Cookjames.c...@wecomm.com wrote: Oh, did you want your action as a spring managed bean? Ah I think i massively miss read you. You want to inject predefined values etc? -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:38 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class thanks. i won't go that route. i noticed your example (in the first response) and i realized that i may trying to push some business logic into the Action class. and, i don't think that's too good of a practice. i simply revised my Service class to hold these values (booleans, String, int, etc...) and now the problem goes away. it's a workaround. if anyone is reading this post and knows how to use struts2 (w/ convention plugin) + spring to construct Action classes, please let me know. the examples i've seen are only with struts1 (and though not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cookjames.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:16 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cookjames.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring xml. -Original Message- From: Jake Vang [mailto:vangj...@googlemail.com] Sent: 13 May 2010 11:09 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class well, there's something strange about struts2 (with convention plugin) + spring. if your action has a field representing a service, MyInjectedService myInjectedService, you just have to define that in the spring xml file. for example, your Action class looks like the following. public class MyAction extends ActionSupport { private Service service; �...@action(value=/dummy) public String dummy() { return SUCCESS; } public Service getService() { return service; } public void setService(Service service) { this.service = service; } } in your spring xml file (i.e. applicationContext.xml), you simply define a bean with the id=service. for example, bean id=service class=my.class.Service/ that's it; you don't have to do anything else. you don't even have to explicitly say (using XML) to inject this when you are creating an instance of MyAction. now when a user accesses /dummy, MyAction will be created and its service field will actually be injected with what is specified in the spring xml file. what irks me or bothers
Re: spring, struts2, convention plugin, how to wire an action class
Jake Vang wrote: If you want Spring to create your action class (as opposed to Struts creating them) then you need to define your action in the applicationContext.xml file. how do you do that? here's a couple of ways i have tried that do NOT work. 1) Add constant name=struts.objectFactory value=org.apache.struts2.spring.StrutsSpringObjectFactory / to your struts.xml file. 2) Add listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener to your web.xml 3) Make sure that you have the Struts2 Spring plugin installed. 4) Put something along the lines of bean id=myAction class=com.somwhere.mypackage.MyAction scope=prototype/ (The scope prototype is important otherwise Spring creates a singleton rather than a new action on each invocation which is what Struts 2 expects) and that should get Spring instantiating your action classes for you. Although I'm guessing from your response you've already got to that stage. I'm not sure that I understand what you are trying to acheive with bean name=/action class=com.services.MyAction property name=propertyA value=${propertyA}/ /bean If you're trying to inject another class, then the format is on the lines of bean name=/action class=com.services.MyAction property name=classA ref=classA/ /bean where you need a setter that matches the name parameter (setClassA(ClassA classA)) in MyAction. The ref value points to another bean id=classA class=com.services.classA/ HTH and I haven't completely misunderstood what you are trying to do. Regards -- View this message in context: http://old.nabble.com/spring%2C-struts2%2C-convention-plugin%2C-how-to-%22wire%22-an-action-class-tp28545412p28547552.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: spring, struts2, convention plugin, how to wire an action class
roger, thanks for the steps. i went through each of those steps and made sure my settings/configurations complied. however, i still cannot initialize Action classes using Spring. as an illustration of the problem i am facing, i have created an example that you may download and verify for yourself that this does not work. http://www.box.net/shared/iycamr9uo6 this will download a zip file with an Eclipse project; unzip it. if you have Ant, you simply type in ant war and the war file will be created. if you have Tomcat, then drop the war file into the webapps directory (assuming you have Tomcat 6.0). if you go to http://localhost:8080/myapp/, you will see four lines displayed. String from Action: default boolean from Action: false String from Service: overwritten boolean from Service: true The first and second lines confirm that the String and boolean values are not injected into the Action class. The third and fourth lines confirm that the String and boolean values are injected into the service class. thanks. On Thu, May 13, 2010 at 9:32 AM, RogerV roger.var...@googlemail.com wrote: Jake Vang wrote: If you want Spring to create your action class (as opposed to Struts creating them) then you need to define your action in the applicationContext.xml file. how do you do that? here's a couple of ways i have tried that do NOT work. 1) Add constant name=struts.objectFactory value=org.apache.struts2.spring.StrutsSpringObjectFactory / to your struts.xml file. 2) Add listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener to your web.xml 3) Make sure that you have the Struts2 Spring plugin installed. 4) Put something along the lines of bean id=myAction class=com.somwhere.mypackage.MyAction scope=prototype/ (The scope prototype is important otherwise Spring creates a singleton rather than a new action on each invocation which is what Struts 2 expects) and that should get Spring instantiating your action classes for you. Although I'm guessing from your response you've already got to that stage. I'm not sure that I understand what you are trying to acheive with bean name=/action class=com.services.MyAction property name=propertyA value=${propertyA}/ /bean If you're trying to inject another class, then the format is on the lines of bean name=/action class=com.services.MyAction property name=classA ref=classA/ /bean where you need a setter that matches the name parameter (setClassA(ClassA classA)) in MyAction. The ref value points to another bean id=classA class=com.services.classA/ HTH and I haven't completely misunderstood what you are trying to do. Regards -- View this message in context: http://old.nabble.com/spring%2C-struts2%2C-convention-plugin%2C-how-to-%22wire%22-an-action-class-tp28545412p28547552.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
Re: spring, struts2, convention plugin, how to wire an action class
My best guess is that the Action instance used in the web application is not actually loaded from the configuration in your applicationContext, but directly by Struts 2 (through the Spring Factory, but still Struts 2). That mean that you will have a bean named myAction in you application context, but that is not the bean that will actually be used by Struts to serve your request. Struts will create another instance, which won't have any of your configuration. This different instance is then autowired by type (defaut behaviour) which means your service (configured in your context) gets injected because it has the right type. I can't actually confirm that behaviour, but that seems like the likely explanation. I will be able to double check tomorrow. To check that, I can recommend 2 things : * Set the autowiring to be by name, create 2 beans named verbose and message, and see how that works * Leaving the autowiring by type, create 2 instances of your service, and my best guess is that Struts will crash, unable to decide between the 2 I think what your are missing is the fact that while struts uses Spring to manage the lifecycle of its action, it doesn't use the action defined in your application context, but will load its own instances, and autowire them. Denis. Le 2010-05-13 20:18, Jake Vang a écrit : roger, thanks for the steps. i went through each of those steps and made sure my settings/configurations complied. however, i still cannot initialize Action classes using Spring. as an illustration of the problem i am facing, i have created an example that you may download and verify for yourself that this does not work. http://www.box.net/shared/iycamr9uo6 this will download a zip file with an Eclipse project; unzip it. if you have Ant, you simply type in ant war and the war file will be created. if you have Tomcat, then drop the war file into the webapps directory (assuming you have Tomcat 6.0). if you go to http://localhost:8080/myapp/, you will see four lines displayed. String from Action: default boolean from Action: false String from Service: overwritten boolean from Service: true The first and second lines confirm that the String and boolean values are not injected into the Action class. The third and fourth lines confirm that the String and boolean values are injected into the service class. thanks. On Thu, May 13, 2010 at 9:32 AM, RogerVroger.var...@googlemail.com wrote: Jake Vang wrote: If you want Spring to create your action class (as opposed to Struts creating them) then you need to define your action in the applicationContext.xml file. how do you do that? here's a couple of ways i have tried that do NOT work. 1) Addconstant name=struts.objectFactory value=org.apache.struts2.spring.StrutsSpringObjectFactory / to your struts.xml file. 2) Addlistener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener to your web.xml 3) Make sure that you have the Struts2 Spring plugin installed. 4) Put something along the lines of bean id=myAction class=com.somwhere.mypackage.MyAction scope=prototype/ (The scope prototype is important otherwise Spring creates a singleton rather than a new action on each invocation which is what Struts 2 expects) and that should get Spring instantiating your action classes for you. Although I'm guessing from your response you've already got to that stage. I'm not sure that I understand what you are trying to acheive with bean name=/action class=com.services.MyAction property name=propertyA value=${propertyA}/ /bean If you're trying to inject another class, then the format is on the lines of bean name=/action class=com.services.MyAction property name=classA ref=classA/ /bean where you need a setter that matches the name parameter (setClassA(ClassA classA)) in MyAction. The ref value points to anotherbean id=classA class=com.services.classA/ HTH and I haven't completely misunderstood what you are trying to do. Regards -- View this message in context: http://old.nabble.com/spring%2C-struts2%2C-convention-plugin%2C-how-to-%22wire%22-an-action-class-tp28545412p28547552.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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
how to integrate struts2 + convention plugin +spring
Hi I'm a Struts 2 newbie .I want to integrate struts2 ,convention plugin and spring. how to do? anyone give me some advice? thanks a lot thomas
Re: how to integrate struts2 + convention plugin +spring
i am still learning the REST implementation :0 still un familiar the class is less than the old one, but work :0 F On Wed, May 13, 2009 at 11:21 PM, chen thomas xproject.tho...@gmail.com wrote: Hi I'm a Struts 2 newbie .I want to integrate struts2 ,convention plugin and spring. how to do? anyone give me some advice? thanks a lot thomas -- -- Frans Thamura Meruvian. Java and Enterprise OSS Mobile: +62 855 7888 699 Blog Profile: http://frans.thamura.info We provide services to migrate your apps to Java (web), in amazing fast and reliable. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to integrate struts2 + convention plugin +spring
I have found a way to determine how to config application-web.xml: Please set break point on the following code of the SpringObjectFactory.java ,which is contained in the xwork-2.1.2.jar, public Object buildBean(String beanName, MapString, Object extraContext, boolean injectInternal) throws Exception { Object o = null; try { o = appContext.getBean(beanName); } catch (NoSuchBeanDefinitionException e) { Class beanClazz = getClassInstance(beanName); o = buildBean(beanClazz, extraContext); } if (injectInternal) { injectInternalBeans(o); } return o; } from the parameter *beanName*, you can know how to config applicationContext-web.xml. 2009/5/14 Frans Thamura fr...@meruvian.org i am still learning the REST implementation :0 still un familiar the class is less than the old one, but work :0 F On Wed, May 13, 2009 at 11:21 PM, chen thomas xproject.tho...@gmail.com wrote: Hi I'm a Struts 2 newbie .I want to integrate struts2 ,convention plugin and spring. how to do? anyone give me some advice? thanks a lot thomas -- -- Frans Thamura Meruvian. Java and Enterprise OSS Mobile: +62 855 7888 699 Blog Profile: http://frans.thamura.info We provide services to migrate your apps to Java (web), in amazing fast and reliable. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to integrate struts2 + convention plugin +spring
chen thomas wrote: I'm a Struts 2 newbie .I want to integrate struts2 ,convention plugin and spring. how to do? anyone give me some advice? I'd probably start by reading the Convention and Spring plugin docs--after that if you have any specific questions this is the place to ask them. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
IllegalArgumentException using struts2-convention-plugin-2.1.6.jar on JBoss
Hi, I'm trying to deploy a struts 2 web application to a JBoss 5.01GA-Server (on Windows System). While this works fine with the Tomcat (5 and 6), JBoss throws an IllegalArgumentException. Here is the associated part of the stack trace: ... 14:10:58,123 INFO [STDOUT] 2009-05-07 14:10:58,123 [INFO ] (org.springframework.web.context.ContextLoader:198) - Root WebApplicationContext: initialization completed in 3500 ms 14:10:58,357 INFO [STDOUT] 2009-05-07 14:10:58,357 [INFO ] (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider:31) - Parsing configuration file [struts-default.xml] 14:10:58,513 INFO [STDOUT] 2009-05-07 14:10:58,513 [INFO ] (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider:31) - Parsing configuration file [struts-plugin.xml] 14:10:58,560 INFO [STDOUT] 2009-05-07 14:10:58,560 [INFO ] (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider:31) - Parsing configuration file [struts.xml] 14:10:58,560 INFO [STDOUT] 2009-05-07 14:10:58,560 [INFO ] (com.opensymphony.xwork2.config.impl.DefaultConfiguration:31) - Overriding property struts.i18n.reload - old value: false new value: true 14:10:58,560 INFO [STDOUT] 2009-05-07 14:10:58,560 [INFO ] (com.opensymphony.xwork2.config.impl.DefaultConfiguration:31) - Overriding property struts.configuration.xml.reload - old value: false new value: true 14:10:58,701 INFO [STDOUT] 2009-05-07 14:10:58,701 [INFO ] (org.apache.struts2.spring.StrutsSpringObjectFactory:31) - Initializing Struts-Spring integration... 14:10:58,701 INFO [STDOUT] 2009-05-07 14:10:58,701 [INFO ] (com.opensymphony.xwork2.spring.SpringObjectFactory:31) - Setting autowire strategy to name 14:10:58,701 INFO [STDOUT] 2009-05-07 14:10:58,701 [INFO ] (org.apache.struts2.spring.StrutsSpringObjectFactory:31) - ... initialized Struts-Spring integration successfully 14:11:10,138 ERROR [[/HimiWeb]] Exception starting filter struts2 java.lang.IllegalArgumentException: URI scheme is not file at java.io.File.init(File.java:366) at org.apache.struts2.convention.classloader.ReloadingClassLoader.init(Re loadingClassLoader.java:53) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.initReload ClassLoader(PackageBasedActionConfigBuilder.java:241) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActio nConfigs(PackageBasedActionConfigBuilder.java:255) at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(Clas spathPackageProvider.java:52) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer (DefaultConfiguration.java:200) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Con figurationManager.java:55) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispa tcher.java:360) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403) I have embedded the struts2-convention-plugin-2.1.6.jar. While executing the ReloadingClassLoader-Constructor (line 53) the root.toURI() produces vfsmemory://5c4o21o-nqcau3-fuffdssr-1-fuffe5bp-1y/, and with that the instantiation of new File(root.toURI()) doesn't work. Can anybody help? Best Regards Alexander Tenzer
Re: IllegalArgumentException using struts2-convention-plugin-2.1.6.jar on JBoss
Could you try to use the latest snapshot build? http://people.apache.org/builds/struts/nightlies/2.x/ If that doesn't help, please register an issue with Jira, JBoss 5 introduced new virtual file system and that the origin of problems https://issues.apache.org/struts/browse/ Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: IllegalArgumentException using struts2-convention-plugin-2.1.6.jar on JBoss
the URI you are supplying vfsmemory://5c4o21o-nqcau3-fuffdssr-1-fuffe5bp-1yis not a valid URI I would use valid prefixes defined here http://www.ietf.org/rfc/rfc2396.txt Viel Gluck, Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. 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. Subject: IllegalArgumentException using struts2-convention-plugin-2.1.6.jar on JBoss Date: Thu, 7 May 2009 14:32:31 +0200 From: alexander.ten...@rsp-gmbh.de To: user@struts.apache.org Hi, I'm trying to deploy a struts 2 web application to a JBoss 5.01GA-Server (on Windows System). While this works fine with the Tomcat (5 and 6), JBoss throws an IllegalArgumentException. Here is the associated part of the stack trace: ... 14:10:58,123 INFO [STDOUT] 2009-05-07 14:10:58,123 [INFO ] (org.springframework.web.context.ContextLoader:198) - Root WebApplicationContext: initialization completed in 3500 ms 14:10:58,357 INFO [STDOUT] 2009-05-07 14:10:58,357 [INFO ] (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider:31) - Parsing configuration file [struts-default.xml] 14:10:58,513 INFO [STDOUT] 2009-05-07 14:10:58,513 [INFO ] (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider:31) - Parsing configuration file [struts-plugin.xml] 14:10:58,560 INFO [STDOUT] 2009-05-07 14:10:58,560 [INFO ] (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider:31) - Parsing configuration file [struts.xml] 14:10:58,560 INFO [STDOUT] 2009-05-07 14:10:58,560 [INFO ] (com.opensymphony.xwork2.config.impl.DefaultConfiguration:31) - Overriding property struts.i18n.reload - old value: false new value: true 14:10:58,560 INFO [STDOUT] 2009-05-07 14:10:58,560 [INFO ] (com.opensymphony.xwork2.config.impl.DefaultConfiguration:31) - Overriding property struts.configuration.xml.reload - old value: false new value: true 14:10:58,701 INFO [STDOUT] 2009-05-07 14:10:58,701 [INFO ] (org.apache.struts2.spring.StrutsSpringObjectFactory:31) - Initializing Struts-Spring integration... 14:10:58,701 INFO [STDOUT] 2009-05-07 14:10:58,701 [INFO ] (com.opensymphony.xwork2.spring.SpringObjectFactory:31) - Setting autowire strategy to name 14:10:58,701 INFO [STDOUT] 2009-05-07 14:10:58,701 [INFO ] (org.apache.struts2.spring.StrutsSpringObjectFactory:31) - ... initialized Struts-Spring integration successfully 14:11:10,138 ERROR [[/HimiWeb]] Exception starting filter struts2 java.lang.IllegalArgumentException: URI scheme is not file at java.io.File.init(File.java:366) at org.apache.struts2.convention.classloader.ReloadingClassLoader.init(Re loadingClassLoader.java:53) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.initReload ClassLoader(PackageBasedActionConfigBuilder.java:241) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActio nConfigs(PackageBasedActionConfigBuilder.java:255) at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(Clas spathPackageProvider.java:52) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer (DefaultConfiguration.java:200) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Con figurationManager.java:55) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispa tcher.java:360) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403) I have embedded the struts2-convention-plugin-2.1.6.jar. While executing the ReloadingClassLoader-Constructor (line 53) the root.toURI() produces vfsmemory://5c4o21o-nqcau3-fuffdssr-1-fuffe5bp-1y
Re: IllegalArgumentException using struts2-convention-plugin-2.1.6.jar on JBoss
to add to what Lukasz said, don't rely too much on the reloading class loader which is experimental, there is a flag to disable it, check the docs. musachy On Thu, May 7, 2009 at 8:42 AM, Lukasz Lenart lukasz.len...@googlemail.com wrote: Could you try to use the latest snapshot build? http://people.apache.org/builds/struts/nightlies/2.x/ If that doesn't help, please register an issue with Jira, JBoss 5 introduced new virtual file system and that the origin of problems https://issues.apache.org/struts/browse/ Regards -- Lukasz http://www.lenart.org.pl/ - 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: IllegalArgumentException using struts2-convention-plugin-2.1.6.jar on JBoss
Filed https://issues.apache.org/struts/browse/WW-3121 Added better error message with hint to disable class reloading. Correct fix needs addtional XWork work, will check tomorrow. Musachy Barroso schrieb: to add to what Lukasz said, don't rely too much on the reloading class loader which is experimental, there is a flag to disable it, check the docs. musachy On Thu, May 7, 2009 at 8:42 AM, Lukasz Lenart lukasz.len...@googlemail.com wrote: Could you try to use the latest snapshot build? http://people.apache.org/builds/struts/nightlies/2.x/ If that doesn't help, please register an issue with Jira, JBoss 5 introduced new virtual file system and that the origin of problems https://issues.apache.org/struts/browse/ Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- René Gielen IT-Neering.net Saarstrasse 100, 52062 Aachen, Germany Tel: +49-(0)241-4010770 Fax: +49-(0)241-4010771 Cel: +49-(0)177-3194448 http://twitter.com/rgielen - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
struts2 convention plugin not scanning classpath
Hi, we're using struts2 2.1.6 convention plugin with annotations on the action classes. When running though eclipse everything works fine, but when deployed to a standalone tomcat 5 the convention plugin does not appear to scan our web app classpath. We normally package all our classes into a jar and include this by the following constants in struts.xml constant name=struts.convention.action.disableScanning value=false / constant name=struts.convention.result.path value=/WEB-INF/content / constant name=struts.convention.default.parent.package value=default / constant name=struts.convention.action.packages value=comrad.web.morepork / constant name=struts.convention.action.includeJars value=.*/morepork.*?jar(!/)? / No errors are generated on startup, it just doesn't configure any of our annotated or automagical convention actions. This problem seems intermittent. Sometimes if we wait a couple of hours or restart tomcat a dozen times, we might get luck and see the convention plugin configure everything correctly. To reiterate, the configuration works perfectly from a development environment (ie eclipse deploying to tomcat). Any help appreciated. Cheers, Tim. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts2 convention plugin not scanning classpath
Set the debugging level to DEBUG, and post it here. BTW, that's an awesome name for a jar file morepork :) musachy On Tue, Mar 10, 2009 at 12:36 AM, Timothy Pick t...@comrad.co.nz wrote: Hi, we're using struts2 2.1.6 convention plugin with annotations on the action classes. When running though eclipse everything works fine, but when deployed to a standalone tomcat 5 the convention plugin does not appear to scan our web app classpath. We normally package all our classes into a jar and include this by the following constants in struts.xml constant name=struts.convention.action.disableScanning value=false / constant name=struts.convention.result.path value=/WEB-INF/content / constant name=struts.convention.default.parent.package value=default / constant name=struts.convention.action.packages value=comrad.web.morepork / constant name=struts.convention.action.includeJars value=.*/morepork.*?jar(!/)? / No errors are generated on startup, it just doesn't configure any of our annotated or automagical convention actions. This problem seems intermittent. Sometimes if we wait a couple of hours or restart tomcat a dozen times, we might get luck and see the convention plugin configure everything correctly. To reiterate, the configuration works perfectly from a development environment (ie eclipse deploying to tomcat). Any help appreciated. Cheers, Tim. - 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: Struts mapping failing when using struts2-convention-plugin
] SEOActionNameBuilder.trace(69) | Changed action name from [SubdivisionController] to [subdivision] DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Got actionName for class [class com.tousa.ws.rest.SubdivisionController] of [subdivision] DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Created package config named [com.tousa.ws.rest#rest-default#] with a namespace [] DEBUG [main] PackageBasedActionConfigBuilder.debug(57) | Creating action config for class [class com.tousa.ws.rest.SubdivisionController], name [subdivision] and package name [com.tousa.ws.rest#rest-default#] in namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Using final calculated namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the Servlet container at [/WEB-INF/content/] with result prefix of [/WEB-INF/content/subdivision] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the class path at [WEB-INF/content/] with a result prefix of [/WEB-INF/content/subdivision] and action name [subdivision] [/code] on any of the above requests, this is the only logged output (to go along with the 404 response): [code] DEBUG [btpool0-2] ConfigurationManager.debug(57) | Checking ConfigurationProviders for reload. DEBUG [btpool0-2] InstantiatingNullHandler.debug(57) | Entering nullPropertyValue [target=[com.opensymphony.xwork2.defaulttextprovi...@3e48f2], property=struts] WARN [btpool0-2] OgnlValueStack.warn(45) | Could not find property [struts.actionMapping] [/code] which seems totally irrelevant. I am spinning my wheels now and have tried numerous things, but I cannot understand why the supposed action configured at startup does not pick up my URLs. Here are my general configs - I have pared down the configuration to a bare minimum, to match the Showcase app, to no avail (yet): struts.xml [code] constant name=struts.convention.action.suffix value=Controller/ constant name=struts.convention.action.mapAllMatches value=true/ constant name=struts.convention.default.parent.package value=rest-default/ constant name=struts.convention.package.locators value=rest/ [/code] web.xml [code] context-param param-namecontextConfigLocation/param-name param-valueclasspath*:applicationContext*.xml/param-value /context-param !-- Filters -- filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping !-- Listeners -- listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener [/code] pom.xml [code] dependencies !-- Struts 2 -- dependency groupIdorg.apache.struts/groupId artifactIdstruts2-core/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-convention-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-spring-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-rest-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.2.1.ga/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency /dependencies [/code] Any suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.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 mapping failing when using struts2-convention-plugin
/dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.2.1.ga/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency /dependencies [/code] Any suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.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: Struts mapping failing when using struts2-convention-plugin
version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-convention-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-spring-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-rest-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.2.1.ga/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency /dependencies [/code] Any suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.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 -- 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: Struts mapping failing when using struts2-convention-plugin
for results in the class path at [WEB-INF/content/] with a result prefix of [/WEB-INF/content/subdivision] and action name [subdivision] [/code] on any of the above requests, this is the only logged output (to go along with the 404 response): [code] DEBUG [btpool0-2] ConfigurationManager.debug(57) | Checking ConfigurationProviders for reload. DEBUG [btpool0-2] InstantiatingNullHandler.debug(57) | Entering nullPropertyValue [target=[com.opensymphony.xwork2.defaulttextprovi...@3e48f2], property=struts] WARN [btpool0-2] OgnlValueStack.warn(45) | Could not find property [struts.actionMapping] [/code] which seems totally irrelevant. I am spinning my wheels now and have tried numerous things, but I cannot understand why the supposed action configured at startup does not pick up my URLs. Here are my general configs - I have pared down the configuration to a bare minimum, to match the Showcase app, to no avail (yet): struts.xml [code] constant name=struts.convention.action.suffix value=Controller/ constant name=struts.convention.action.mapAllMatches value=true/ constant name=struts.convention.default.parent.package value=rest-default/ constant name=struts.convention.package.locators value=rest/ [/code] web.xml [code] context-param param-namecontextConfigLocation/param-name param-valueclasspath*:applicationContext*.xml/param-value /context-param !-- Filters -- filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping !-- Listeners -- listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener [/code] pom.xml [code] dependencies !-- Struts 2 -- dependency groupIdorg.apache.struts/groupId artifactIdstruts2-core/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-convention-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-spring-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-rest-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.2.1.ga/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency /dependencies [/code] Any suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.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 -- 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 -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22380845.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: Struts mapping failing when using struts2-convention-plugin
action config for class [class com.tousa.ws.rest.SubdivisionController], name [subdivision] and package name [com.tousa.ws.rest#rest-default#] in namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Using final calculated namespace [] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the Servlet container at [/WEB-INF/content/] with result prefix of [/WEB-INF/content/subdivision] DEBUG [main] DefaultResultMapBuilder.trace(69) | Searching for results in the class path at [WEB-INF/content/] with a result prefix of [/WEB-INF/content/subdivision] and action name [subdivision] [/code] on any of the above requests, this is the only logged output (to go along with the 404 response): [code] DEBUG [btpool0-2] ConfigurationManager.debug(57) | Checking ConfigurationProviders for reload. DEBUG [btpool0-2] InstantiatingNullHandler.debug(57) | Entering nullPropertyValue [target=[com.opensymphony.xwork2.defaulttextprovi...@3e48f2], property=struts] WARN [btpool0-2] OgnlValueStack.warn(45) | Could not find property [struts.actionMapping] [/code] which seems totally irrelevant. I am spinning my wheels now and have tried numerous things, but I cannot understand why the supposed action configured at startup does not pick up my URLs. Here are my general configs - I have pared down the configuration to a bare minimum, to match the Showcase app, to no avail (yet): struts.xml [code] constant name=struts.convention.action.suffix value=Controller/ constant name=struts.convention.action.mapAllMatches value=true/ constant name=struts.convention.default.parent.package value=rest-default/ constant name=struts.convention.package.locators value=rest/ [/code] web.xml [code] context-param param-namecontextConfigLocation/param-name param-valueclasspath*:applicationContext*.xml/param-value /context-param !-- Filters -- filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping !-- Listeners -- listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener [/code] pom.xml [code] dependencies !-- Struts 2 -- dependency groupIdorg.apache.struts/groupId artifactIdstruts2-core/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-convention-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-spring-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.apache.struts/groupId artifactIdstruts2-rest-plugin/artifactId version2.1.6/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.1.ga/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.2.1.ga/version /dependency dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId version1.0/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency /dependencies [/code] Any suggestions? I guess I will be going through source code now - the showcase example makes it seem so simple, and I cannot see what little switch I have missing or need to remove. Thanks for ideas. -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22379807.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 -- 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 -- View this message in context: http://www.nabble.com/Struts-mapping-failing-when-using-struts2-convention-plugin-tp22379807p22380845.html Sent from the Struts - User mailing list
Re: [Struts2] Convention Plugin
Hi, You have to configure struts to tell where your actions are: filter filter-nameaction2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class init-param param-nameactionPackages/param-name param-valueyour.package.actions/param-value /init-param /filter Action class must pass such name convention ActionNameAction.class, eg. EmployeeAction will be mapped as a employee.action, namespace will be created base on package prefix, eg. your.package.actions.employee.AddAction will give add.action in namespace /employee The same convention is for results, eg. if employee.action return success it will be mapped to employee-success.jsp I also have such settings in my struts.properties but I don't know which version do you use struts.convention.action.packages = you.package.actions struts.convention.result.path = / -- where to search you jsp files Regards -- Lukasz http://www.lenart.org.pl/
Re: [Struts2] Convention Plugin
No, that's the codebehind plugin. On Sat, Jun 7, 2008 at 5:15 AM, Lukasz Lenart [EMAIL PROTECTED] wrote: Hi, You have to configure struts to tell where your actions are: filter filter-nameaction2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class init-param param-nameactionPackages/param-name param-valueyour.package.actions/param-value /init-param /filter Action class must pass such name convention ActionNameAction.class, eg. EmployeeAction will be mapped as a employee.action, namespace will be created base on package prefix, eg. your.package.actions.employee.AddAction will give add.action in namespace /employee The same convention is for results, eg. if employee.action return success it will be mapped to employee-success.jsp I also have such settings in my struts.properties but I don't know which version do you use struts.convention.action.packages = you.package.actions struts.convention.result.path = / -- where to search you jsp files Regards -- Lukasz http://www.lenart.org.pl/ -- 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]
Re: [Struts2] Convention Plugin
Did you take a look at the docs: http://cwiki.apache.org/S2PLUGINS/convention-plugin.html? To get you started do this: 1. Create an action in actions.TestAction, and write an execute() method that return success. 2. Create the file /WEB-INF/content/test.jsp 3. Point your browser to: http://localhost:8080/context/test That should be it. Make sure that the plugin is getting deployed to the lib folder of your app. You can also enable logging to see what is going on (convention plugin can be quite verbose) musachy On Fri, Jun 6, 2008 at 1:33 PM, vikofvan [EMAIL PROTECTED] wrote: How do I configure the plugin to work? I compiled the plugin and xwork using the latest source, and am using the latest successful build of struts2 (build 825) but it does not find the action at runtime. I tried using the plugin annotations also. The plugin looks very promising, if only I can get it to work. Thanks. vikram Musachy Barroso wrote: You will have to build xwork also, those classes are new. musachy On Wed, Jun 4, 2008 at 5:18 PM, vikofvan [EMAIL PROTECTED] wrote: Thanks for providing the link to the source of convention plugin; am unable to compile the plugin as com.opensymphony.xwork2.util.finder.* is missing from xwork 2.1.1. Thanks. vikram Musachy Barroso wrote: The Convention plugin has not been released yet, it is in the sandbox here: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/ musachy On Wed, Jun 4, 2008 at 4:13 PM, vikofvan [EMAIL PROTECTED] wrote: Where can I get hold of the strust2 convention plugin? It seems to be missing from the 2.1.2 build. Thanks. Vikram -- View this message in context: http://www.nabble.com/-Struts2--Convention-Plugin-tp17655614p17655614.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] -- 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/-Struts2--Convention-Plugin-tp17655614p17656884.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] -- 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/-Struts2--Convention-Plugin-tp17655614p17696902.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] -- 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]
Re: [Struts2] Convention Plugin
How do I configure the plugin to work? I compiled the plugin and xwork using the latest source, and am using the latest successful build of struts2 (build 825) but it does not find the action at runtime. I tried using the plugin annotations also. The plugin looks very promising, if only I can get it to work. Thanks. vikram Musachy Barroso wrote: You will have to build xwork also, those classes are new. musachy On Wed, Jun 4, 2008 at 5:18 PM, vikofvan [EMAIL PROTECTED] wrote: Thanks for providing the link to the source of convention plugin; am unable to compile the plugin as com.opensymphony.xwork2.util.finder.* is missing from xwork 2.1.1. Thanks. vikram Musachy Barroso wrote: The Convention plugin has not been released yet, it is in the sandbox here: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/ musachy On Wed, Jun 4, 2008 at 4:13 PM, vikofvan [EMAIL PROTECTED] wrote: Where can I get hold of the strust2 convention plugin? It seems to be missing from the 2.1.2 build. Thanks. Vikram -- View this message in context: http://www.nabble.com/-Struts2--Convention-Plugin-tp17655614p17655614.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] -- 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/-Struts2--Convention-Plugin-tp17655614p17656884.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] -- 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/-Struts2--Convention-Plugin-tp17655614p17696902.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]
[Struts2] Convention Plugin
Where can I get hold of the strust2 convention plugin? It seems to be missing from the 2.1.2 build. Thanks. Vikram -- View this message in context: http://www.nabble.com/-Struts2--Convention-Plugin-tp17655614p17655614.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]
Re: [Struts2] Convention Plugin
The Convention plugin has not been released yet, it is in the sandbox here: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/ musachy On Wed, Jun 4, 2008 at 4:13 PM, vikofvan [EMAIL PROTECTED] wrote: Where can I get hold of the strust2 convention plugin? It seems to be missing from the 2.1.2 build. Thanks. Vikram -- View this message in context: http://www.nabble.com/-Struts2--Convention-Plugin-tp17655614p17655614.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] -- 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]
Re: [Struts2] Convention Plugin
Thanks for providing the link to the source of convention plugin; am unable to compile the plugin as com.opensymphony.xwork2.util.finder.* is missing from xwork 2.1.1. Thanks. vikram Musachy Barroso wrote: The Convention plugin has not been released yet, it is in the sandbox here: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/ musachy On Wed, Jun 4, 2008 at 4:13 PM, vikofvan [EMAIL PROTECTED] wrote: Where can I get hold of the strust2 convention plugin? It seems to be missing from the 2.1.2 build. Thanks. Vikram -- View this message in context: http://www.nabble.com/-Struts2--Convention-Plugin-tp17655614p17655614.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] -- 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/-Struts2--Convention-Plugin-tp17655614p17656884.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]
Re: [Struts2] Convention Plugin
You will have to build xwork also, those classes are new. musachy On Wed, Jun 4, 2008 at 5:18 PM, vikofvan [EMAIL PROTECTED] wrote: Thanks for providing the link to the source of convention plugin; am unable to compile the plugin as com.opensymphony.xwork2.util.finder.* is missing from xwork 2.1.1. Thanks. vikram Musachy Barroso wrote: The Convention plugin has not been released yet, it is in the sandbox here: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/ musachy On Wed, Jun 4, 2008 at 4:13 PM, vikofvan [EMAIL PROTECTED] wrote: Where can I get hold of the strust2 convention plugin? It seems to be missing from the 2.1.2 build. Thanks. Vikram -- View this message in context: http://www.nabble.com/-Struts2--Convention-Plugin-tp17655614p17655614.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] -- 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/-Struts2--Convention-Plugin-tp17655614p17656884.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] -- 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]