Migrating data from one select box to other.
I have two select box. Suppose the initial values of the select boxes are as follow :- s:select name = select1 list=#{'Mandatory':'Mandatory', 'Optional':'Optional', 'Critical':'Critical'} size=3/ s:select name = select2 list=#{'Mandatory':'Mandatory'} size=3/ There will be two button Add and Remove. So when user select one element of select1 and click Add button, the element should migrate to the select2 box. And the remove button will do the opposite. Can anyone please tell me how to do that in struts2 or how to write the javascript for that. -- Thanks Regards Arpan Debroy
s:action / tag doesn't work in sitemesh decorator file...
that's part of my decorator file: - next is web.xml struts-cleanup org.apache.struts2.dispatcher.ActionContextCleanUp sitemesh com.opensymphony.module.sitemesh.filter.PageFilter struts2 org.apache.struts2.dispatcher.FilterDispatcher struts-cleanup /* REQUEST FORWARD sitemesh /* struts2 /* REQUEST FORWARD -- View this message in context: http://www.nabble.com/%3Cs%3Aaction--%3E-tag-doesn%27t-work-in-sitemesh-decorator-file...-tp16696536p16696536.html Sent from the Struts - User mailing list archive at Nabble.com.
Re: Migrating data from one select box to other.
Hi Ryan, Thats lovely.. :) But I don't want so many buttons. I need only two button as Add and Remove. How to do that? On Tue, Apr 15, 2008 at 12:31 PM, Ryan [EMAIL PROTECTED] wrote: I believe these will help you out a bit: http://struts.apache.org/2.0.11/docs/optiontransferselect.html http://www.roseindia.net/struts/struts2/struts2uitags/optiontransferselect-tag.shtml Cheers! Ryan On Tue, Apr 15, 2008 at 1:54 AM, Arpan Debroy [EMAIL PROTECTED] wrote: I have two select box. Suppose the initial values of the select boxes are as follow :- s:select name = select1 list=#{'Mandatory':'Mandatory', 'Optional':'Optional', 'Critical':'Critical'} size=3/ s:select name = select2 list=#{'Mandatory':'Mandatory'} size=3/ There will be two button Add and Remove. So when user select one element of select1 and click Add button, the element should migrate to the select2 box. And the remove button will do the opposite. Can anyone please tell me how to do that in struts2 or how to write the javascript for that. -- Thanks Regards Arpan Debroy -- Thanks Regards Arpan Debroy
Re: Migrating data from one select box to other.
I believe these will help you out a bit: http://struts.apache.org/2.0.11/docs/optiontransferselect.html http://www.roseindia.net/struts/struts2/struts2uitags/optiontransferselect-tag.shtml Cheers! Ryan On Tue, Apr 15, 2008 at 1:54 AM, Arpan Debroy [EMAIL PROTECTED] wrote: I have two select box. Suppose the initial values of the select boxes are as follow :- s:select name = select1 list=#{'Mandatory':'Mandatory', 'Optional':'Optional', 'Critical':'Critical'} size=3/ s:select name = select2 list=#{'Mandatory':'Mandatory'} size=3/ There will be two button Add and Remove. So when user select one element of select1 and click Add button, the element should migrate to the select2 box. And the remove button will do the opposite. Can anyone please tell me how to do that in struts2 or how to write the javascript for that. -- Thanks Regards Arpan Debroy
Re: Migrating data from one select box to other.
Thanks Ryan, My purpose is done. There are lot of options to change the label of the buttons and to remove them from the page also. On Tue, Apr 15, 2008 at 12:55 PM, Arpan Debroy [EMAIL PROTECTED] wrote: Hi Ryan, Thats lovely.. :) But I don't want so many buttons. I need only two button as Add and Remove. How to do that? On Tue, Apr 15, 2008 at 12:31 PM, Ryan [EMAIL PROTECTED] wrote: I believe these will help you out a bit: http://struts.apache.org/2.0.11/docs/optiontransferselect.html http://www.roseindia.net/struts/struts2/struts2uitags/optiontransferselect-tag.shtml Cheers! Ryan On Tue, Apr 15, 2008 at 1:54 AM, Arpan Debroy [EMAIL PROTECTED] wrote: I have two select box. Suppose the initial values of the select boxes are as follow :- s:select name = select1 list=#{'Mandatory':'Mandatory', 'Optional':'Optional', 'Critical':'Critical'} size=3/ s:select name = select2 list=#{'Mandatory':'Mandatory'} size=3/ There will be two button Add and Remove. So when user select one element of select1 and click Add button, the element should migrate to the select2 box. And the remove button will do the opposite. Can anyone please tell me how to do that in struts2 or how to write the javascript for that. -- Thanks Regards Arpan Debroy -- Thanks Regards Arpan Debroy -- Thanks Regards Arpan Debroy
Is there such a thing as flash in S2?
Flash scope is fairly common nowdays (for displaying messages) I wonder if S2 2.011, has anything similar? thanks, Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there such a thing as flash in S2?
Oh, didn't see the 2.0.11.1 requirement...not sure if the message store interceptor code is in that branch, but the scope plugin should work just fine. Don On Tue, Apr 15, 2008 at 7:19 PM, Don Brown [EMAIL PROTECTED] wrote: There is the Struts 2 Scope Plugin [1], which does flash scope and a lot more. Also, the message store interceptor, available in core out-of-the-box, will persist action and error messages across a redirect in a flash scope, which is very handy for registering validation errors on a POST but having the response redirect the user to a GET. Don [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman [EMAIL PROTECTED] wrote: Flash scope is fairly common nowdays (for displaying messages) I wonder if S2 2.011, has anything similar? thanks, Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HOW TO SPECIFY AN ACTION WITH A PARAMETER
hello everybody, my need would be to click a link in my web page, and to associate a variable parameter to it, giving the possibility to the action java code to recognize the parameter string and compute a logic depending on its value; to be more clear, i visualize a dinamyc number of links, one for each id reflecting a DB query computed before to obtain the id value list, and thus, i would like to use this id as a parameter for the same action for every link; tha action should use the id parameter to compute a second query, with the id used as a key-field. How to specify the invocation of an action passing a parameter? i mean, how to invoke it via html, and how to read the parameter via action java code? Thanks a lot for every answer, Marco and Daniele - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there such a thing as flash in S2?
There is the Struts 2 Scope Plugin [1], which does flash scope and a lot more. Also, the message store interceptor, available in core out-of-the-box, will persist action and error messages across a redirect in a flash scope, which is very handy for registering validation errors on a POST but having the response redirect the user to a GET. Don [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman [EMAIL PROTECTED] wrote: Flash scope is fairly common nowdays (for displaying messages) I wonder if S2 2.011, has anything similar? thanks, Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Scheduled DB clean up service with Spring
Hi, back again with my problem. The root cause is: SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService': Injection of persistence methods failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.quartz.SimpleTriggerBean] for bean with name 'simpleTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:323) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:966) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:462) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:430) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:254) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:198) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.quartz.SimpleTriggerBean] for bean with name 'simpleTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1140) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:514) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:222) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:298) at
Re: HOW TO SPECIFY AN ACTION WITH A PARAMETER
On Tue, Apr 15, 2008 at 11:33 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hello everybody, my need would be to click a link in my web page, and to associate a variable parameter to it, giving the possibility to the action java code to recognize the parameter string and compute a logic depending on its value; to be more clear, i visualize a dinamyc number of links, one for each id reflecting a DB query computed before to obtain the id value list, and thus, i would like to use this id as a parameter for the same action for every link; tha action should use the id parameter to compute a second query, with the id used as a key-field. This is all what web applications are about, don't you think? :-) How to specify the invocation of an action passing a parameter? i mean, how to invoke it via html, and how to read the parameter via action java code? You don't need to read parameters passed like in plain servlets, they're injected into your action when it has the appropriate properties (setter/getter). Take a look at the bootstrap section[1] from the struts tutorials[2] on the homepage as a starting point, and take a look at the showcase app, it should have tons of examples for this. Cheers, -Ralf [1] http://struts.apache.org/2.0.11.1/docs/bootstrap.html [2] http://struts.apache.org/2.0.11.1/docs/tutorials.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Scheduled DB clean up service with Spring
The error message is pretty clear, you're missing some classes in your classpath. The compile time classpath and runtime classpath is usually not the same. Make sure that you have the required jar files in your runtime classpath. Nils-H On Tue, Apr 15, 2008 at 12:04 PM, Peter Theissen [EMAIL PROTECTED] wrote: Hi, back again with my problem. The root cause is: SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService': Injection of persistence methods failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.quartz.SimpleTriggerBean] for bean with name 'simpleTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:323) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:966) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:462) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:430) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:254) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:198) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.quartz.SimpleTriggerBean] for bean with name 'simpleTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1140) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:514) at
Type conversion with enum elements
Hello, I wish to display/read value that belongs to an enumerated type. Struts seems to handle Class and Enum differently. For instance, *xwork-conversion* com.company.utils.Constants.EducationalQualification=com.company.ui.utils.EducationalQualificationConverter java.util.Date=com.loandukaan.ui.utils.DateConverter For the date parameter, the converter gets invoked. Whereas, for the type EducationalQualification, the converter doesnt get invoked and the set method in the form bean fails. Any thoughts? -- Thanks Ram
Re: Type conversion with enum elements
hi, A simple workaround would be defining the bean property as String type rather than as the actual enum. Then use the two enum type built in operations name() and valueOf() to implement the getter and setter respectively. If there is actually an elegant way to do it, I would also be interested to know. regards, Giovanni Ramanathan RV wrote: Hello, I wish to display/read value that belongs to an enumerated type. Struts seems to handle Class and Enum differently. For instance, *xwork-conversion* com.company.utils.Constants.EducationalQualification=com.company.ui.utils.EducationalQualificationConverter java.util.Date=com.loandukaan.ui.utils.DateConverter For the date parameter, the converter gets invoked. Whereas, for the type EducationalQualification, the converter doesnt get invoked and the set method in the form bean fails. Any thoughts? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Type conversion with enum elements
Hi On Tue, Apr 15, 2008 at 12:29 PM, Ramanathan RV [EMAIL PROTECTED] wrote: Hello, I wish to display/read value that belongs to an enumerated type. Struts seems to handle Class and Enum differently. For instance, *xwork-conversion* com.company.utils.Constants.EducationalQualification=com.company.ui.utils.EducationalQualificationConverter java.util.Date=com.loandukaan.ui.utils.DateConverter For the date parameter, the converter gets invoked. Whereas, for the type EducationalQualification, the converter doesnt get invoked and the set method in the form bean fails. Any thoughts? Actually this is xwork-behaviour. It already provides the class com.opensymphony.xwork2.util.EnumTypeConverter[1], which you can simply use to convert your Enum: xwork-conversion.properties: foo.bar.MyEnumeration = com.opensymphony.xwork2.util.EnumTypeConverter If you don't like the default behaviour using the Enum name() as representation in the page, you can always write your own type converter[2]. Cheers, -Ralf [1] http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/util/EnumTypeConverter.html [2] http://struts.apache.org/2.0.11.1/docs/type-conversion.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: How do I insert a file into mySQL?
Perhaps this would be better asked on a mailing list relating to databases. --- ryan webb [EMAIL PROTECTED] wrote: I want to store a file (any file mp3, avi, etc) on the database without using blob datatype. No, you want to store the path of a file in the database. I just want to put the address of the file (in my Hard Disck) [...] See? in mySQL and load the address of the file to be played on web page. but I have no idea how this can be done. That confuses me. Why wouldn't you just store the path of the file in the database like you're saying you want to? You provided an example of it. What are you really asking, and how is it related to Struts? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Spring: Interceptors, prototype or singleton?
Just about every single S2 action I have ever created uses Spring to inject a service object of some sort into the action. I use Spring for transactions, SLSB's, MDB's, JDBC, Hibernate, you name it. Ganfab asked about injecting a new instance of an object into a custom interceptor on every action call and my thinking was that Spring had only constructor or setter injection and that interceptors were always singletons, so the injected bean would always be a singleton. Well I just found in Spring 2.5 they have lookup method injection which can be used to create a new instance of an object from the Spring bean factory and inject them into a Singleton. Using this you could inject new instances and declare your interceptor in a package and not have to declare it for every action needing this type of interceptor. See 3.3.7.1. http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#bea ns-factory-method-injection I hope I'm being clear about what I mean. :) Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Martin Gainty [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Mon, 14 Apr 2008 21:50:15 -0400 To: Struts Users Mailing List user@struts.apache.org Subject: Re: [S2] Spring: Interceptors, prototype or singleton? Could you provide a scenario where one bean is injected into another? Thanks M- - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, April 14, 2008 3:55 PM Subject: Re: [S2] Spring: Interceptors, prototype or singleton? So the interceptor would have to be declared at the action level in this case then? If I have a spring bean named myBean that is default scope and I inject another bean declared as a prototype into it, the injected bean will still be a singleton since there will be only one instance of myBean. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Don Brown [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 15 Apr 2008 01:12:49 +1000 To: Struts Users Mailing List user@struts.apache.org Subject: Re: [S2] Spring: Interceptors, prototype or singleton? To clarify, interceptors aren't technically singletons as each instance in an interceptor stack gets its own interceptor instance. However, for all requests using that stack, the same interceptor will be used. Therefore, you do need to be careful. For example, most interceptors take parameters that configure their use within the stack, like the validation interceptor that takes a list of excluded methods from validation. Interceptors can be configured at the stack level or at the action level. If at the action level, you will get a unique interceptor instance for that action. If you want Spring to construct your interceptor, I recommend the prototype scope, so that Struts gets a new instance of the interceptor as expected. Don On Tue, Apr 15, 2008 at 12:48 AM, Randy Burgess [EMAIL PROTECTED] wrote: Interceptors are Singletons according to the documentation. If it were me I would come up with another method besides Spring for changing object properties. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: GF [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Mon, 14 Apr 2008 14:51:25 +0200 To: Struts Users ML user@struts.apache.org Subject: [S2] Spring: Interceptors, prototype or singleton? In a guide I found on the web, the interceptor was defined as singleton in the Spring's ApplicationContext. If I need to use changeable object properties, I need to have it as Prototype, otherwise different requests will result in a object property overwriting. Is there any issues about defining an interceptor as Prototype, or is it ok? Thanks GF This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.
Re: Is there such a thing as flash in S2?
There is also a flash result type / interceptor in webwork - very easy (2 min) to convert to s2. /Ian Don Brown wrote: There is the Struts 2 Scope Plugin [1], which does flash scope and a lot more. Also, the message store interceptor, available in core out-of-the-box, will persist action and error messages across a redirect in a flash scope, which is very handy for registering validation errors on a POST but having the response redirect the user to a GET. Don [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman [EMAIL PROTECTED] wrote: Flash scope is fairly common nowdays (for displaying messages) I wonder if S2 2.011, has anything similar? thanks, Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 + AjaxTags + DisplayTag
Well your requestURI is not set so the URL is set to the current JSP and not the action. I have never had any success leaving requestURI blank with DisplayTag on S1 or S2. I always set it to the name of an action. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Márcio Gurgel [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 15 Apr 2008 01:18:34 -0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Struts 2 + AjaxTags + DisplayTag Matt, tanks for your help. But I need to persist with displayTags /: I guess that there's some kind of validation inside struts 2 that doesnt allow the correct work of ajaxtags.. Just take a look at my generated url from displaytag pagination. http://localhost:8080/SGVDBA/view/usuario/UsuPesquisaResultados.jsp? currentUsu.eMail=currentUsu.chv=currentUsu.dtGvr=struts.enableJSONValidatio n=true buttonPesquisar=Pesquisardojo.currentUsu.dtGvr=d-49489-p=2 Tanks all! 2008/4/14, matt.payne [EMAIL PROTECTED]: You could try struts2 + jquery + jgrid (http://trirand.com/jqgrid/jqgrid.html) If you need ajax, you need something that returns an json or xml response (insert you velocity, freemarker, json result, jsp result here). Matt Márcio Gurgel wrote: Hi all! Since this morning I'm having troubles to configure ajaxTags in my project. I followed the steps from ajaxTags web site, I also saw the ajaxTags show case wich contains a example of display:table. But doen't work... Is there some kind os special configuration for struts 2? My displayTable is inside a sx:tabbedPanelsx:div I also tried to use: useSelectedTabCookie=useSelectedTabCookie to select the correct tab when my displayTable pagination submits the page. In this case, the content of the first tab doesn't appear. Regards. Márcio Gurgel -- View this message in context: http://www.nabble.com/Struts-2-%2B-AjaxTags-%2B-DisplayTag-tp16670438p1668945 8.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] This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.
RE: Is there such a thing as flash in S2?
link to the webwork Flash result Ian mentioned: http://wiki.opensymphony.com/display/WW/Flash+Result Brad Cupit Louisiana State University - UIS -Original Message- From: Ian Roughley [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 15, 2008 8:39 AM To: Struts Users Mailing List Subject: Re: Is there such a thing as flash in S2? There is also a flash result type / interceptor in webwork - very easy (2 min) to convert to s2. /Ian Don Brown wrote: There is the Struts 2 Scope Plugin [1], which does flash scope and a lot more. Also, the message store interceptor, available in core out-of-the-box, will persist action and error messages across a redirect in a flash scope, which is very handy for registering validation errors on a POST but having the response redirect the user to a GET. Don [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman [EMAIL PROTECTED] wrote: Flash scope is fairly common nowdays (for displaying messages) I wonder if S2 2.011, has anything similar? thanks, Alex. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Loading Resource bundles dynamically for users
Hi, I am planning to use struts 2. But in my application , I have to load different resouce bundle for different group of users. For Instance, User A, Belongs to Group A logs into the application, different set of labels need to be displayed. User B, Belongs to Group B logs into the application, different set of labels need to be displayed. Is this feature available in struts2? Is it possible to extend struts 2 to implement this feature? I could not find enough material in the net. I have gone through document and partialy tag libraries. Struts 2 uses valuestack for bundles. It is registered in configProvider class. But I am not when this method is invoked. Thanks. Cheers, Karuna =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
Re: [OT] Scheduled DB clean up service with Spring
INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger You missed some quartz jar file. 2008/4/15, Peter Theissen [EMAIL PROTECTED]: Hi, back again with my problem. The root cause is: SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService': Injection of persistence methods failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.quartz.SimpleTriggerBean] for bean with name 'simpleTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:323) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:966) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:462) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:430) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:254) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:198) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.scheduling.quartz.SimpleTriggerBean] for bean with name 'simpleTrigger' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/quartz/SimpleTrigger at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1140) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:514) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:222) at
Having trouble pre-populating a checkboxlist
I must be missing something obvious here, but I can't seem to get my checkboxlist to prepopulate. s:checkboxlist name=platformsKeys value=platformsKeys list=allPlatforms listKey=value listValue=label / platformsKeys is a array of integers and allPlatforms is a list of objects with the key being an integer and the value being a string. Here is what the HTML looks like: input type=checkbox name=platformsKeys value=1 id=platformsKeys-1/ label for=platformsKeys-1 class=checkboxLabelQueries/label input type=checkbox name=platformsKeys value=2 id=platformsKeys-2/ label for=platformsKeys-2 class=checkboxLabelAlerts/label When I use the form to create the values for platformsKeys, it works fine. But when I return to the form with platformsKeys having values in it, I would expect the checkboxes to be checked where they match the values that are found in platformsKeys. But they aren't. What am I doing wrong? -- View this message in context: http://www.nabble.com/Having-trouble-pre-populating-a-checkboxlist-tp16703411p16703411.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]
Validation vetoing Action invocation
I am facing an interesting situation and looking for feedback. I am really enjoying minimal action configurations such as: action name=wizard_* class=acme.action.wizard.Wizard method={1} result/pages/wizard/${nextPage}.jsp/result /action where my action class can decide which page to display next. This works fine unless a validation fails, which short circuits the action call altogether. I discovered the DefaultWorkflowInterceptor was checking for errors using a call to validationAwareAction.hasErrors() and decided to override the hasErrors() behavior in my base action class to return false. This allows me to determine navigation in my action class independent of the String return type and multiple result lookup code in the struts.xml mappings. All of this and I continue to get appropriate validation messages. What seems odd is that I would have to default the hasErrors() behavior this way. Is there a switch or flag where I can configure the framework to execute action always? I realize the framework navigation logic is wired to use the symbolic names as opposed to names in the action class itself. However, I feel like you should be able to use both schemes without weird code in a base class. Peace, Scott -- View this message in context: http://www.nabble.com/Validation-vetoing-Action-invocation-tp16703623p16703623.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: Validation vetoing Action invocation
No, the workflow interceptor will check for errors and return 'input' if there are any: http://svn.opensymphony.com/fisheye/browse/~raw,r=1630/xwork/trunk/src/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptor.java In your case, why don't you remove the workflow interceptor? musachy On Tue, Apr 15, 2008 at 6:24 PM, stanlick [EMAIL PROTECTED] wrote: I am facing an interesting situation and looking for feedback. I am really enjoying minimal action configurations such as: action name=wizard_* class=acme.action.wizard.Wizard method={1} result/pages/wizard/${nextPage}.jsp/result /action where my action class can decide which page to display next. This works fine unless a validation fails, which short circuits the action call altogether. I discovered the DefaultWorkflowInterceptor was checking for errors using a call to validationAwareAction.hasErrors() and decided to override the hasErrors() behavior in my base action class to return false. This allows me to determine navigation in my action class independent of the String return type and multiple result lookup code in the struts.xml mappings. All of this and I continue to get appropriate validation messages. What seems odd is that I would have to default the hasErrors() behavior this way. Is there a switch or flag where I can configure the framework to execute action always? I realize the framework navigation logic is wired to use the symbolic names as opposed to names in the action class itself. However, I feel like you should be able to use both schemes without weird code in a base class. Peace, Scott -- View this message in context: http://www.nabble.com/Validation-vetoing-Action-invocation-tp16703623p16703623.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: Clean some characters in request parameters
hernan gonzalez wrote: Assume I have a lot of html forms with text inputs, and I want to palce some restrictions for the set of allowed chars. Sort of a sanity check, at the charset level. For a concrete example, my storage (db) uses LATIN9 (iso-8859-15), and the user sometimes can enter the non-allowed acute-accent (instead of the intended-correct apostrophe). In this -and similar cases- I want to detect it (replacing it with the good character, or throwing an error). I wish to do it globally, not field by field... though not for the entire application, but for a set of actions. I was thinking of an interceptor that operates at the HttpServletRequest level, before the ParametersInterceptor is applied (I don't care if the http param corresponds to a String property), but this does not seem very straightforward , as the HttpServletRequest does not allow to manipulate the params. Any suggestion or pointer? There's nothing in Struts that will take care of this directly. Ideally your users should be able to enter whatever characters they want; I would be looking at how to get the database layer to cooperate, instead of imposing arbitrary input restrictions based on the current database configuration. That said, here are some ideas to consider that might help get this done: - to simply validate input and reject any that is outside the target character set, you could implement a custom validator; - to transliterate the input (performing character conversions to force the input into the target character set), you could implement a custom converter - to apply either strategy to *all* inputs for a particular action or set of actions, you would want to use an interceptor. I would guess you'd need to call actionInvocation.getActionContext().setParameters() with your 'manipulated' request parameter data. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Scheduled DB clean up service with Spring
Hi all, sorry to continue with that OT thread, but its starting to get really mad out here. But first of all, thanks for the hint that the runtime classpath (rcp) has to be configured independently. Well, I tried that but it ended up in a mess! Of course, first thing I did was adding spring.jar to rcp of the Apache... and I was awating the startup of my Webapp joyfully. The joy ended quite soon with the following message below (***) Then I added servlet-api.jar to the rcp and another exception. For every exception I got, I added a new (corresponding) jar file. This ended up in a NullPointerEx. I guess thats because the order of the jar files is also important. However, to add those jars to the rcp, I added them in the Run Dialog under Classpath, first I tried that under User Entries and then under Bootstrap Entries in different permutations and so on and so on. Happy trial and error. But after some hours I have to admint: that doesnt make sense any longer. Can it be so difficult to use load class of the Spring Lib at runttime and create it as a bean? bean id=simpleTrigger class=org.springframework.scheduling.quartz.SimpleTriggerBean / If I omit this line, I have no problem to start the app at all! In that case, my webApp works perfectly with default config: Bootstrap Entries: JRE System Lib jre_1.6.0_5 User Entries: bootstrap.jar How can I find out what the required jar files are to add to the rcp except Spring.jar and in which order do I have to provide them. Which of them have to be in Bootstrap Entries and which one in User Entries? Could anybody point me to the rigth direction, please? I have lost the rigth path ;-) Thanks and best regards Peter PS: sorry if my question is not formulated professional, Im quite new to all that JavaWebFramework stuff. (***) java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1275) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 28 more - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Clean some characters in request parameters
There's nothing in Struts that will take care of this directly. Ideally your users should be able to enter whatever characters they want; I would be looking at how to get the database layer to cooperate, instead of imposing arbitrary input restrictions based on the current database configuration. That said, here are some ideas to consider that might help get this done: - to simply validate input and reject any that is outside the target character set, you could implement a custom validator; - to transliterate the input (performing character conversions to force the input into the target character set), you could implement a custom converter - to apply either strategy to *all* inputs for a particular action or set of actions, you would want to use an interceptor. I would guess you'd need to call actionInvocation.getActionContext().setParameters() with your 'manipulated' request parameter data. Good answer. Thanks. Hernán - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Spring: Interceptors, prototype or singleton?
Yes very clear thank you so the default assignment of scope=singleton happens under these scenarios: 1)bean creation defaulting to singleton as in ApplicationContext 2)beanFactory supports registerSingleton then a singleton bean can be set to lazy-initialize (that is not be pre-instantiated). For all other situations the default of prototype is implied This statement about Method Injection is extremely problematic woth regards to singletons For most application scenarios, the majority of the beans in the container will be singletons. When a singleton bean needs to collaborate with another singleton bean, or a non-singleton bean needs to collaborate with another non-singleton bean, the typical and common approach of handling this dependency by defining one bean to be a property of the other is quite adequate. There is a problem when the bean lifecycles are different. Consider a singleton bean A which needs to use a non-singleton (prototype) bean B, perhaps on each method invocation on A. The container will only create the singleton bean A once, and thus only get the opportunity to set the properties once. There is no opportunity for the container to provide bean A with a new instance of bean B every time one is needed. So if prototype bean B changes A has no clue.. I think I'll stay with the scope=prototype/singleton in the declarator.. Thanks, Martin - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, April 15, 2008 9:51 AM Subject: Re: [S2] Spring: Interceptors, prototype or singleton? Just about every single S2 action I have ever created uses Spring to inject a service object of some sort into the action. I use Spring for transactions, SLSB's, MDB's, JDBC, Hibernate, you name it. Ganfab asked about injecting a new instance of an object into a custom interceptor on every action call and my thinking was that Spring had only constructor or setter injection and that interceptors were always singletons, so the injected bean would always be a singleton. Well I just found in Spring 2.5 they have lookup method injection which can be used to create a new instance of an object from the Spring bean factory and inject them into a Singleton. Using this you could inject new instances and declare your interceptor in a package and not have to declare it for every action needing this type of interceptor. See 3.3.7.1. http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#bea ns-factory-method-injection I hope I'm being clear about what I mean. :) Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Martin Gainty [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Mon, 14 Apr 2008 21:50:15 -0400 To: Struts Users Mailing List user@struts.apache.org Subject: Re: [S2] Spring: Interceptors, prototype or singleton? Could you provide a scenario where one bean is injected into another? Thanks M- - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, April 14, 2008 3:55 PM Subject: Re: [S2] Spring: Interceptors, prototype or singleton? So the interceptor would have to be declared at the action level in this case then? If I have a spring bean named myBean that is default scope and I inject another bean declared as a prototype into it, the injected bean will still be a singleton since there will be only one instance of myBean. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Don Brown [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 15 Apr 2008 01:12:49 +1000 To: Struts Users Mailing List user@struts.apache.org Subject: Re: [S2] Spring: Interceptors, prototype or singleton? To clarify, interceptors aren't technically singletons as each instance in an interceptor stack gets its own interceptor instance. However, for all requests using that stack, the same interceptor will be used. Therefore, you do need to be careful. For example, most interceptors take parameters that configure their use within the stack, like the validation interceptor that takes a list of excluded methods from validation. Interceptors can be configured at the stack level or at the action level. If at the action level, you will get a unique interceptor instance for that action. If you want Spring to construct your interceptor, I recommend the prototype scope, so that Struts gets a new instance of the interceptor as expected. Don On Tue, Apr 15, 2008 at 12:48 AM, Randy Burgess [EMAIL PROTECTED] wrote: Interceptors are Singletons according to the documentation. If it were me I would come up with another method besides Spring for changing object properties. Regards, Randy Burgess Sr. Web
Problem with Select tag
Hi, I'm using Struts 2.0.11.1, and I have wierd problem with select UI tag. It works perfectly, but when I added namespace to the package in struts.xml, which is used in form where this select tag is located, I get an error: tag 'select', field 'list', id 'roles', name 'user.roles': The requested list key 'allRoles' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unkown location] I should note that I've added this namespace to the form tag too, where select tag is located. How can I solve this problem ? It seems when namespace is added to package, select's list attribute doesn't recognize correct value stack anymore. ___ Thanks in advance, Milan Milanovic Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
s:property with dynamic values
Hi there, I have an action/form that contains properties x, y, z with values 1, 2, 3. I have a .JSP where I want to write out the values of them dynamically. c:set var=currentProperty value=x/ How do I write a s:property value=/ using currentProperty that would result it showing my actions value (1). If I were using runtime expressions I would write it like s:property value=${currentProperty}/ but that is verboten by the tld. All help is appreciated, Jonathan -- View this message in context: http://www.nabble.com/%3Cs%3Aproperty-with-dynamic-values-tp16711862p16711862.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: s:property with dynamic values
--- JRD [EMAIL PROTECTED] wrote: I have a .JSP where I want to write out the values of them dynamically. c:set var=currentProperty value=x/ How do I write a s:property value=/ using currentProperty that would result it showing my actions value (1). If I were using runtime expressions I would write it like s:property value=${currentProperty}/ but that is verboten by the tld. Why wouldn't you just use ${x} (in a JSP 2.0+ container) or s:property value=x/? If you're dead-set on using the currentProperty thing use ${currentProperty} or s:property value=currentProperty/. Or use s:set name=currentProperty value=x/ with either the bare JSP 2.0+ notation or via s:property value=#currentProperty/. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 Portlet with custom interceptors
I am trying to implement a custom exception mapping interceptor to be used in my struts2 portlet. I implemented my own ExceptionMappingInterceptor class that is similar to com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor, the only difference is that I send an email with the exception report to the application administrators. I have used this same interceptor successfully in a regular struts2 application. The problem I am having is that it appears that the action is being called and the exception caught by some other class before it gets to my interceptor even though my interceptor is declared first in my stack. Since my custom interceptor is first in my stack shouldn't it be the first thing to catch an exception begin thrown from my action? *My interceptor looks like this in struts.xml:* interceptors interceptor name=customException class=edu.suu.struts2.interceptor.ExceptionMappingInterceptor/ interceptor-stack name=myStack interceptor-ref name=customException/ interceptor-ref name=portletDefaultStack/ /interceptor-stack /interceptors default-interceptor-ref name=myStack/ * Here is my debug logging:* DEBUG [com.opensymphony.xwork2.DefaultActionInvocation] - Executing action method = optIn DEBUG [edu.suu.googleapps.portlet.OptInAction] - optIn() ---exception is thrown here--- DEBUG [org.apache.struts2.portlet.result.PortletResult] - Executing result in Event phase DEBUG [org.apache.struts2.portlet.result.PortletResult] - Setting event render parameter: /WEB-INF/jsp/error.jsp DEBUG [edu.suu.struts2.interceptor.ExceptionMappingInterceptor] - result = error DEBUG [edu.suu.struts2.interceptor.ExceptionMappingInterceptor] - No exceptions caught DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher] - Leaving processAction DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher] - Entering render DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher] - serviceAction DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher] - Creating action proxy for name = renderDirect, namespace = DEBUG [com.opensymphony.xwork2.DefaultActionProxy] - Creating an DefaultActionProxy for namespace and action name renderDirect DEBUG [org.apache.struts2.portlet.interceptor.PortletStateInterceptor] - Restoring value stack from event phase DEBUG [org.apache.struts2.portlet.interceptor.PortletStateInterceptor] - Restored stack DEBUG [com.opensymphony.xwork2.interceptor.I18nInterceptor] - intercept '/renderDirect' { DEBUG [com.opensymphony.xwork2.interceptor.I18nInterceptor] - requested_locale=null * The interceptor looks like this:* public String intercept(ActionInvocation invocation) throws Exception { HttpServletRequest request = ServletActionContext.getRequest(); String result = null; try { logger.debug(Invoking action, looking for exceptions.); result = invocation.invoke(); logger.debug(result = + result); logger.debug(No exceptions caught); } catch (Exception ex) { logger.debug(Exceptions caught); ex.printStackTrace(); .. } return result; }
S2GWTDemo
hi there (esp Mus), I am try-ing Struts2GWTPlugins Demo and i got there is 2 project, 1 the client and the other is the web, both under the src i have succesfully make the web become the war. and i see the other folder struts2gwtdemoclient, it is a GWT project can u explain to me, how to compile the GWT project and deployed to struts2gwtpluginweb F
Re: [OT] Scheduled DB clean up service with Spring
As a basic rule of thumb, you shall _never_ add the servlet-api.jar or servlet.jar to the WEB-INF/lib folder (if that's what you are doing) Consider reading this: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html If problems remains, consider then asking the right question to the appropiate forum. 2008/4/15, Peter Theissen [EMAIL PROTECTED]: Hi all, sorry to continue with that OT thread, but its starting to get really mad out here. But first of all, thanks for the hint that the runtime classpath (rcp) has to be configured independently. Well, I tried that but it ended up in a mess! Of course, first thing I did was adding spring.jar to rcp of the Apache... and I was awating the startup of my Webapp joyfully. The joy ended quite soon with the following message below (***) Then I added servlet-api.jar to the rcp and another exception. For every exception I got, I added a new (corresponding) jar file. This ended up in a NullPointerEx. I guess thats because the order of the jar files is also important. However, to add those jars to the rcp, I added them in the Run Dialog under Classpath, first I tried that under User Entries and then under Bootstrap Entries in different permutations and so on and so on. Happy trial and error. But after some hours I have to admint: that doesnt make sense any longer. Can it be so difficult to use load class of the Spring Lib at runttime and create it as a bean? bean id=simpleTrigger class=org.springframework.scheduling.quartz.SimpleTriggerBean / If I omit this line, I have no problem to start the app at all! In that case, my webApp works perfectly with default config: Bootstrap Entries: JRE System Lib jre_1.6.0_5 User Entries: bootstrap.jar How can I find out what the required jar files are to add to the rcp except Spring.jar and in which order do I have to provide them. Which of them have to be in Bootstrap Entries and which one in User Entries? Could anybody point me to the rigth direction, please? I have lost the rigth path ;-) Thanks and best regards Peter PS: sorry if my question is not formulated professional, Im quite new to all that JavaWebFramework stuff. (***) java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1275) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 28 more - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
redirect-action and redirect
Hi All, I am facing a strange issue. I am using Struts 2.0.11 on Websphere 6.1 with JDK 1.5. Thing is, I am using result type redirect-action and redirect to redirect to a different action for certain scenarios in my action class. This works fine from my local workstation. But when we deploy our app in the test environment, it still works, but the url that we see after redirection is of the app server url and not the web server url. For example, I invoked action as http://www.somedomain.com/appContext/some.action at this point, some.action will be invoked and I do some processing inside my execute method and I return result which is of type redirect-action and the action name is redirectFile.action So, after redirection, I expect to see the url as http://www.somedomain.com/appContext/redirectFile.action but instead, I see as http://www.appServer.com/appContext/redirectFile.action I mean, the flow works without any issues but why does the url changing? We do have a webserver running on app server box but this never happend with Struts 1.x. So, what is Struts2 redirect-action result type doing special that is causing this? And any idea how to resolve this? Thanks in advance.
Re: Struts 2 + AjaxTags + DisplayTag
Hi Randy, I also tried to set requestURI. I'm having lots of problems with components inside tabbedPanels... For example: This example works outside a tabbed panel: 2. Attach to onmouseover, and onclick event on Area below and update content of Div1, highlight targets with green color sx:bind id=ex2 href=%{#urlAbrirDadosGerais} sources=div2 targets=div1 events=onmouseover,onclick highlightColor=green/ div id=div2 style=width: 300px; height: 50px; border: 1px solid black Mouse Over or Click Here! /div When its inside a div from tabbedpanel just doesn't work. Does anyone can help me? 2008/4/15, Randy Burgess [EMAIL PROTECTED]: Well your requestURI is not set so the URL is set to the current JSP and not the action. I have never had any success leaving requestURI blank with DisplayTag on S1 or S2. I always set it to the name of an action. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Márcio Gurgel [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 15 Apr 2008 01:18:34 -0300 To: Struts Users Mailing List user@struts.apache.org Subject: Re: Struts 2 + AjaxTags + DisplayTag Matt, tanks for your help. But I need to persist with displayTags /: I guess that there's some kind of validation inside struts 2 that doesnt allow the correct work of ajaxtags.. Just take a look at my generated url from displaytag pagination. http://localhost:8080/SGVDBA/view/usuario/UsuPesquisaResultados.jsp? currentUsu.eMail=currentUsu.chv=currentUsu.dtGvr=struts.enableJSONValidatio n=true buttonPesquisar=Pesquisardojo.currentUsu.dtGvr=d-49489-p=2 Tanks all! 2008/4/14, matt.payne [EMAIL PROTECTED]: You could try struts2 + jquery + jgrid (http://trirand.com/jqgrid/jqgrid.html) If you need ajax, you need something that returns an json or xml response (insert you velocity, freemarker, json result, jsp result here). Matt Márcio Gurgel wrote: Hi all! Since this morning I'm having troubles to configure ajaxTags in my project. I followed the steps from ajaxTags web site, I also saw the ajaxTags show case wich contains a example of display:table. But doen't work... Is there some kind os special configuration for struts 2? My displayTable is inside a sx:tabbedPanelsx:div I also tried to use: useSelectedTabCookie=useSelectedTabCookie to select the correct tab when my displayTable pagination submits the page. In this case, the content of the first tab doesn't appear. Regards. Márcio Gurgel -- View this message in context: http://www.nabble.com/Struts-2-%2B-AjaxTags-%2B-DisplayTag-tp16670438p1668945 8.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] This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.
Re: [S2] Spring: Interceptors, prototype or singleton?
I've never used that method of injection so I wouldn't comment on it one way or another, I just found it in the Spring documentation. If you don't declare the scope for a Spring bean it defaults to singleton. It will never be a prototype unless you explicitly declare it as such using either annotations or XML. Randy From: Martin Gainty [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 15 Apr 2008 17:16:03 -0400 To: Struts Users Mailing List user@struts.apache.org Subject: Re: [S2] Spring: Interceptors, prototype or singleton? Yes very clear thank you so the default assignment of scope=singleton happens under these scenarios: 1)bean creation defaulting to singleton as in ApplicationContext 2)beanFactory supports registerSingleton then a singleton bean can be set to lazy-initialize (that is not be pre-instantiated). For all other situations the default of prototype is implied This statement about Method Injection is extremely problematic woth regards to singletons For most application scenarios, the majority of the beans in the container will be singletons. When a singleton bean needs to collaborate with another singleton bean, or a non-singleton bean needs to collaborate with another non-singleton bean, the typical and common approach of handling this dependency by defining one bean to be a property of the other is quite adequate. There is a problem when the bean lifecycles are different. Consider a singleton bean A which needs to use a non-singleton (prototype) bean B, perhaps on each method invocation on A. The container will only create the singleton bean A once, and thus only get the opportunity to set the properties once. There is no opportunity for the container to provide bean A with a new instance of bean B every time one is needed. So if prototype bean B changes A has no clue.. I think I'll stay with the scope=prototype/singleton in the declarator.. Thanks, Martin - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, April 15, 2008 9:51 AM Subject: Re: [S2] Spring: Interceptors, prototype or singleton? Just about every single S2 action I have ever created uses Spring to inject a service object of some sort into the action. I use Spring for transactions, SLSB's, MDB's, JDBC, Hibernate, you name it. Ganfab asked about injecting a new instance of an object into a custom interceptor on every action call and my thinking was that Spring had only constructor or setter injection and that interceptors were always singletons, so the injected bean would always be a singleton. Well I just found in Spring 2.5 they have lookup method injection which can be used to create a new instance of an object from the Spring bean factory and inject them into a Singleton. Using this you could inject new instances and declare your interceptor in a package and not have to declare it for every action needing this type of interceptor. See 3.3.7.1. http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#bea ns-factory-method-injection I hope I'm being clear about what I mean. :) Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Martin Gainty [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Mon, 14 Apr 2008 21:50:15 -0400 To: Struts Users Mailing List user@struts.apache.org Subject: Re: [S2] Spring: Interceptors, prototype or singleton? Could you provide a scenario where one bean is injected into another? Thanks M- - Original Message - From: Randy Burgess [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, April 14, 2008 3:55 PM Subject: Re: [S2] Spring: Interceptors, prototype or singleton? So the interceptor would have to be declared at the action level in this case then? If I have a spring bean named myBean that is default scope and I inject another bean declared as a prototype into it, the injected bean will still be a singleton since there will be only one instance of myBean. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Don Brown [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 15 Apr 2008 01:12:49 +1000 To: Struts Users Mailing List user@struts.apache.org Subject: Re: [S2] Spring: Interceptors, prototype or singleton? To clarify, interceptors aren't technically singletons as each instance in an interceptor stack gets its own interceptor instance. However, for all requests using that stack, the same interceptor will be used. Therefore, you do need to be careful. For example, most interceptors take parameters that configure their use within the stack, like the validation interceptor that takes a list of excluded methods from validation. Interceptors can be
RE: [OT] Scheduled DB clean up service with Spring
Hi Peter, Please try adding the quartz.jar or spring-quartz.jar to your classpath. You can check out http://www.springframework.org for the dependencies of the spring version you're using. Pls don't add anymore jars at the moment. Also, I would suggest reverting your original classpath settings prior to testing the above, to isolate issues. Reginald Javier -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 16, 2008 4:10 AM To: Struts Users Mailing List Subject: Re: [OT] Scheduled DB clean up service with Spring Hi all, sorry to continue with that OT thread, but its starting to get really mad out here. But first of all, thanks for the hint that the runtime classpath (rcp) has to be configured independently. Well, I tried that but it ended up in a mess! Of course, first thing I did was adding spring.jar to rcp of the Apache... and I was awating the startup of my Webapp joyfully. The joy ended quite soon with the following message below (***) Then I added servlet-api.jar to the rcp and another exception. For every exception I got, I added a new (corresponding) jar file. This ended up in a NullPointerEx. I guess thats because the order of the jar files is also important. However, to add those jars to the rcp, I added them in the Run Dialog under Classpath, first I tried that under User Entries and then under Bootstrap Entries in different permutations and so on and so on. Happy trial and error. But after some hours I have to admint: that doesnt make sense any longer. Can it be so difficult to use load class of the Spring Lib at runttime and create it as a bean? bean id=simpleTrigger class=org.springframework.scheduling.quartz.SimpleTriggerBean / If I omit this line, I have no problem to start the app at all! In that case, my webApp works perfectly with default config: Bootstrap Entries: JRE System Lib jre_1.6.0_5 User Entries: bootstrap.jar How can I find out what the required jar files are to add to the rcp except Spring.jar and in which order do I have to provide them. Which of them have to be in Bootstrap Entries and which one in User Entries? Could anybody point me to the rigth direction, please? I have lost the rigth path ;-) Thanks and best regards Peter PS: sorry if my question is not formulated professional, Im quite new to all that JavaWebFramework stuff. (***) java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1275) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 28 more - To unsubscribe, e-mail:
Re: [OT] Re: How do I insert a file into mySQL?
Dear Dave, Thank you for your time in replying to my mail. Yes you are correct my english is quite confusing. I will follow your advise and ask to database mailing-list. regards, Ryan Webb On 4/15/08, Dave Newton [EMAIL PROTECTED] wrote: Perhaps this would be better asked on a mailing list relating to databases. --- ryan webb [EMAIL PROTECTED] wrote: I want to store a file (any file mp3, avi, etc) on the database without using blob datatype. No, you want to store the path of a file in the database. I just want to put the address of the file (in my Hard Disck) [...] See? in mySQL and load the address of the file to be played on web page. but I have no idea how this can be done. That confuses me. Why wouldn't you just store the path of the file in the database like you're saying you want to? You provided an example of it. What are you really asking, and how is it related to Struts? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to open a page in new window with s:a or s:url tag?
I myself found the solution. To open link in the new window, do as it is mentioned below. s:url id='abc' action='xyz'/s:url s:a href='#' onclick=javascript:window,open('%{abc}');test/s:a this is working for me. I hope this solution can help you guys also. =) Mohiit wrote: I am using Struts 2. I want to open the page in the new window when I click on an icon. I am using s:a tag and giving action by s:url tag. i.e., s:url id='abc' action='xyz',/s:url s:a href='%{abc}'/s:a This way it is opening an action in same page. I want it in the new window like in HTML tag we can do it by link . What is the way in struts 2 for this..? Struts 2's s:a tag doesn't support this. The solution is to use a combination of s:url and a vanilla HTML anchor tag: s:url id='abc' ... ${abc} -- View this message in context: http://www.nabble.com/How-to-open-a-page-in-new-window-with-%3Cs%3Aa%3E-or-%3Cs%3Aurl%3E-tag--tp16601857p16716797.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]