Should I use redirect-action or dispatcher?
Hi, After logging in am providing a hyperlink to the user to update his details.After clicking on that link,i need to forward to other new page with field values populated.So inorder to redirect it to a new page,should I use redirect-action or dispatcher and why?Is that type=dispatcher or dispatch-action in struts2? Any reply is greatly appreciated... Thanks. -- View this message in context: http://www.nabble.com/Should-I-use-redirect-action-or-dispatcher--tp15998990p15998990.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: How to Populate jsp with values in the database ?
Hi, I doesn't mean about having access to database from jsp.What I mean is, what is the syntax of jstl tags to reference the beans placed in the context. Anyways, Thanks for replies,I solved the problem by just mapping using the attribute 'name' in s:textfield/. Thanks. dkarr wrote: The basic idea is to have Java code in Action classes interface to your data sources and populate beans that are put into the contexts available to your JSP code. You then forward to JSP pages that can use Struts or JSTL tags to reference the beans placed into the context. Your JSP should not have database access code at all. -Original Message- From: RajiR [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2008 10:58 PM To: user@struts.apache.org Subject: Re: How to Populate jsp with values in the database ? HI, I have inserted some values(userId,password,email,address,phoneno and id as primary key with autoincrement) into database.After logging into the application,i have kept the userId in session and retrived remaining values by passing userId into database.And then,I have set these values to my form bean register. My Problem is I need to populate these values into a jsp page inorder to update the details.How can I use formbean.fieldname in struts2 inorder to populate.What is the syntax of using those tags?Which tags should I use, is that OGNL or JSTL and why? Plzzz reply as soon as possible..waiting for your replies eagerly... Thanks.. RajiR wrote: -- View this message in context: http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-d atabase---tp15998376p15998387.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-database---tp15998376p16020991.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: Should I use redirect-action or dispatcher?
Thanks for the informative reply newton.dave wrote: --- RajiR [EMAIL PROTECTED] wrote: So inorder to redirect it to a new page, should I use redirect-action or dispatcher and why? http://struts.apache.org/2.0.11.1/docs/redirect-action-result.html http://struts.apache.org/2.0.11.1/docs/dispatcher-result.html Why? Because they do entirely different things. Is that type=dispatcher or dispatch-action in struts2? http://struts.apache.org/2.0.11.1/docs/result-types.html http://struts.apache.org/2.0.11.1/docs/struts-defaultxml.html The redirect-action result type is, surprisingly, named redirect-action, although that particular naming convention is deprecated and has been changed to redirectAction. The hyphenated names, IIRC, are no longer present in S2.1. Both conventions are available since S2.0.7. http://struts.apache.org/2.0.11.1/docs/release-notes-207.html Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Should-I-use-redirect-action-or-dispatcher--tp15998990p16020997.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]
How to Populate jsp with values in the database ?
-- View this message in context: http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-database---tp15998376p15998376.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: How to Populate jsp with values in the database ?
HI, I have inserted some values(userId,password,email,address,phoneno and id as primary key with autoincrement) into database.After logging into the application,i have kept the userId in session and retrived remaining values by passing userId into database.And then,I have set these values to my form bean register. My Problem is I need to populate these values into a jsp page inorder to update the details.How can I use formbean.fieldname in struts2 inorder to populate.What is the syntax of using those tags?Which tags should I use, is that OGNL or JSTL and why? Plzzz reply as soon as possible..waiting for your replies eagerly... Thanks.. RajiR wrote: -- View this message in context: http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-database---tp15998376p15998387.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]
Problem while reading applicationContext.xml file automatically in integrating struts2+springs2.5+hiberante3.2
HI, I have injected springs into struts2 using applicationContext.xml file.While inserting records into database,am getting spring session by again loading applicationContext.xml file using a java class.Here is that java class: package service; import org.springframework.context.ApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import java.util.Map; import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; public class ServiceFinder { private static ApplicationContext ctx = null; public static Object getBean(ServletRequest request, String beanName) { if (ctx == null) { if (!(request instanceof HttpServletRequest)) { throw new IllegalArgumentException( Can only process HttpServletRequest); } HttpServletRequest httpRequest = (HttpServletRequest) request; ctx = getContext(httpRequest); } Object obj= new Object(); return obj; } /** * Allows test cases to override where application context obtained from. * * @param httpRequest which can be used to find the *codeServletContext/code * * @return the Spring application context */ public static ApplicationContext getContext(HttpServletRequest httpRequest) { return WebApplicationContextUtils.getRequiredWebApplicationContext( httpRequest.getSession().getServletContext()); } } So i have just used getHibernateTemplate() method inorder to do transactions in my hibernatedao implementation. My problem is: if i don't write above java class to explicitly load applicationContext.xml file am getting getHibernateTemplate() as null and getting a NPE.Why is it happening?I would like to use getHibernateTemplate() method without explicitly loading appContext.xml file since its already loaded at the time of starting my application(deploying the project) using tomcat..Any idea is greatly appreciated? Plz reply as early as possible...replies plzz -- View this message in context: http://www.nabble.com/Problem-while-reading-applicationContext.xml-file-automatically-in-integrating-struts2%2Bsprings2.5%2Bhiberante3.2-tp15873124p15873124.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]
Page field values becoming null while navigating to a new page
Hi All, I have a login page with userId and password as its fields and its corresponding ActionClass-validation.xml file to validate the page.After logging in i have provided a link called updateProfile inorder to update the details provided by user during the time of registration by forwarding to another jsp page with pre-populated values i.e., the values which has entered during registration and which has to be modified. But after clicking on the link all the model bean values are becoming null and throwing validation that userid and password are required.How to keep track of the page field values while navigating to a new page? -- View this message in context: http://www.nabble.com/Page-field-values-becoming-null-while-navigating-to-a-new-page-tp15827167p15827167.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: HOw to send form parameters to dao in struts2 with hibernate?
Hi, I have a field in my jsp page to enter emailaddress. Inorder to validate it i have used thefield-validator type=email but its not validating.Its only validating for strings(type=requiredstring) and if type=required and page is submitting .What may b the reason? Also,If I have inserted details into the database with a particular primary key value.I should not again insert the same id and shud throw a custom validation msg that UserId already registered.How to throw custom validations in struts2? Thanks. Randy Burgess-3 wrote: If you have your service and DAO defined in a Spring application context you would normally have the DAO as a property of your service or you would have a constructor-ref for it. Spring has to be bootstrapped somehow so use either the spring plugin and define your action as a spring bean and reference the service bean as a property of your action or you need to instantiate Spring using ClassPathXmlApplicationContext or one of the other Spring context objects. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: RajiR [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 27 Feb 2008 22:23:26 -0800 (PST) To: user@struts.apache.org Subject: HOw to send form parameters to dao in struts2 with hibernate? Hi, By implementing Preparable,ModelDriven,ServletRequestAware interfaces,am able to get the form details and sent those details to service implementation layer from an action class.From service implementation i have called dao.Since DAO is not injected any where in struts.xml,its throwing nullpointerexception.I have used only hibernate.Is it required to use springs inorder to inject dao?Or,can I inject using hibernate and struts2 alone?? And what is the use of interceptor concept?Does it help to do dao injection without using spring?If so,how to use it? Plzzz reply as early as possible... Thanks. -- View this message in context: http://www.nabble.com/HOw-to-send-form-parameters-to-dao-in-struts2-with-hiber nate--tp15730459p15730459.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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/HOw-to-send-form-parameters-to-dao-in-struts2-with-hibernate--tp15730459p15797569.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: HOw to send form parameters to dao in struts2 with hibernate?
Hi, Here is my another problem!! I have a register page called userRegister.jsp and its success page registersuccess.jsp.Also,the users who have registered should login from page userlogin.jsp and its success page is loginsuccess.jsp.After logging in, user is given a privilege to update his/her profile by means of a hyperlink.After clicking on this link he/she should be forwarded to userRegister.jsp along with previously registered values.Here my problem is: After clicking on hyper link am forwarding to corresponding page but with validations as userId and password as required,as all the field values in the page has become null and it is forwarding to that page i.e., userRegister.jsp(as input result is declared in struts.xml) even before calling my action method. why this happens?Any help...? Thanks.. RajiR wrote: Hi, I have a field in my jsp page to enter emailaddress. Inorder to validate it i have used thefield-validator type=email but its not validating.Its only validating for strings(type=requiredstring) and if type=required and page is submitting .What may b the reason? Also,If I have inserted details into the database with a particular primary key value.I should not again insert the same id and shud throw a custom validation msg that UserId already registered.How to throw custom validations in struts2? Thanks. Randy Burgess-3 wrote: If you have your service and DAO defined in a Spring application context you would normally have the DAO as a property of your service or you would have a constructor-ref for it. Spring has to be bootstrapped somehow so use either the spring plugin and define your action as a spring bean and reference the service bean as a property of your action or you need to instantiate Spring using ClassPathXmlApplicationContext or one of the other Spring context objects. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: RajiR [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Wed, 27 Feb 2008 22:23:26 -0800 (PST) To: user@struts.apache.org Subject: HOw to send form parameters to dao in struts2 with hibernate? Hi, By implementing Preparable,ModelDriven,ServletRequestAware interfaces,am able to get the form details and sent those details to service implementation layer from an action class.From service implementation i have called dao.Since DAO is not injected any where in struts.xml,its throwing nullpointerexception.I have used only hibernate.Is it required to use springs inorder to inject dao?Or,can I inject using hibernate and struts2 alone?? And what is the use of interceptor concept?Does it help to do dao injection without using spring?If so,how to use it? Plzzz reply as early as possible... Thanks. -- View this message in context: http://www.nabble.com/HOw-to-send-form-parameters-to-dao-in-struts2-with-hiber nate--tp15730459p15730459.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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/HOw-to-send-form-parameters-to-dao-in-struts2-with-hibernate--tp15730459p15798465.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: HOw to send form parameters to dao in struts2 with hibernate?
Thanks for the reply.. Actaully am able to call dao layer from my service implementation and able to insert values into db with and without using springs.Its working fine in both scenarios. NExt i need to authenticate this registered user and should log in.Trying this and vill get back to forum if struck up anywhere. sarat.pediredla wrote: RajiR, How is the service implementation layer being instantiated? The best way is to use the Spring plugin as defined at http://struts.apache.org/2.0.11/docs/spring-plugin.html to inject objects into your actions manage dependancy injection. For more on interceptors and what they do, see http://struts.apache.org/2.x/docs/interceptors.html for detail. Finally, might be worth having a read through the manual at http://struts.apache.org/2.x/docs/core-developers-guide.html which although aimed at devs, has a good insight into the framework. RajiR wrote: Hi, By implementing Preparable,ModelDriven,ServletRequestAware interfaces,am able to get the form details and sent those details to service implementation layer from an action class.From service implementation i have called dao.Since DAO is not injected any where in struts.xml,its throwing nullpointerexception.I have used only hibernate.Is it required to use springs inorder to inject dao?Or,can I inject using hibernate and struts2 alone?? And what is the use of interceptor concept?Does it help to do dao injection without using spring?If so,how to use it? Plzzz reply as early as possible... Thanks. -- View this message in context: http://www.nabble.com/HOw-to-send-form-parameters-to-dao-in-struts2-with-hibernate--tp15730459p15733658.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+Spring+Hibernate Integration
Hi, In the link provided below,it uses struts1+hibernate+spring.I have done tht and trying to do the same application in struts2.So now i have a jsp page to enter user details and to register and after clicking on submit button entered values should be saved into database for which I have used mapping files(hbm.xml) and connected to database using hibernate alone(hibernate.cfg.xml file).I am not injecting springs as of now inorder to connect to database,instead i have used hibernate pooling.I would like to use spring webservices while logging into the application after this registration process,but vill come to tht later. My present problem is after writing struts.xml,jsp pages,java class with all fields in the table and mapping hbm.xml file, I would like to insert entered details into database using hibernate i.e., I need to get the entered details and to set it to the java class(form bean kind of),so that i can send them to the hibernate dao implementation inorder to save the values.But how to get the user entered values and for what i have to set them?Since action form concept is not there in struts2.I can provide u with the code if required.. Looking forward to get a favourable hint.Plz reply as soon as possible. Thanks. Deepak Kumar wrote: Hi, Here is and application with example code http://www.roseindia.net/struts/hibernate-spring/index.shtml Thanks -Original Message- From: RajiR [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 4:04 PM To: user@struts.apache.org Subject: struts2+Spring+Hibernate Integration Hi, As struts2 comes along with spring integration with struts2-spring-plugin-2.0.11.jar,after starting the tomcat server its unable to load that jar and getting an exception as: SEVERE: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/E:/Struts2WorkSpace/.metadata/.plugins/org.eclipse.wst.server.core /tmp0/wtpwebapps/SampleStruts2/WEB-INF/lib/struts2-spring-plugin-2.0.11.jar! /struts-plugin.xml:30:132 . Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware at java.lang.ClassLoader.defineClass1(Native Method) ..com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.regi ster(XmlConfigurationProvider.java:180) ... 24 more What is the reason for this?I have checked whether I have loaded same jar double times,but tht's not tht problem.what might b the reason?Does any body came across this one? Also,the link: http://www.roseindia.net/struts/hibernate-spring/integrate.shtml helps in integrating struts1+hibernate+springs.But, since I would like to work with struts2+Hibernate+Spring,what modifications I have to do to satisfy my requirement?Since action forms concept is not there in struts2...!!! Thanks. -- View this message in context: http://www.nabble.com/struts2%2BSpring%2BHibernate-Integration-tp15607260p15 607260.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/struts2%2BSpring%2BHibernate-Integration-tp15607260p15708410.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+Spring+Hibernate Integration
Hi, By implementing Preparable,ModelDriven,ServletRequestAware interfaces,am able to get the form details and sent those details to service implementation layer from an action class.From service implementation i have called dao.Since DAO is not injected any where in struts.xml,its throwing nullpointerexception.I have used only hibernate.Is it required to use springs inorder to inject dao?Or,can I inject using hibernate and struts2 alone?? Replies pl Thanks. RajiR wrote: Hi, In the link provided below,it uses struts1+hibernate+spring.I have done tht and trying to do the same application in struts2.So now i have a jsp page to enter user details and to register and after clicking on submit button entered values should be saved into database for which I have used mapping files(hbm.xml) and connected to database using hibernate alone(hibernate.cfg.xml file).I am not injecting springs as of now inorder to connect to database,instead i have used hibernate pooling.I would like to use spring webservices while logging into the application after this registration process,but vill come to tht later. My present problem is after writing struts.xml,jsp pages,java class with all fields in the table and mapping hbm.xml file, I would like to insert entered details into database using hibernate i.e., I need to get the entered details and to set it to the java class(form bean kind of),so that i can send them to the hibernate dao implementation inorder to save the values.But how to get the user entered values and for what i have to set them?Since action form concept is not there in struts2.I can provide u with the code if required.. Looking forward to get a favourable hint.Plz reply as soon as possible. Thanks. Deepak Kumar wrote: Hi, Here is and application with example code http://www.roseindia.net/struts/hibernate-spring/index.shtml Thanks -Original Message- From: RajiR [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 4:04 PM To: user@struts.apache.org Subject: struts2+Spring+Hibernate Integration Hi, As struts2 comes along with spring integration with struts2-spring-plugin-2.0.11.jar,after starting the tomcat server its unable to load that jar and getting an exception as: SEVERE: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/E:/Struts2WorkSpace/.metadata/.plugins/org.eclipse.wst.server.core /tmp0/wtpwebapps/SampleStruts2/WEB-INF/lib/struts2-spring-plugin-2.0.11.jar! /struts-plugin.xml:30:132 . Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware at java.lang.ClassLoader.defineClass1(Native Method) ..com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.regi ster(XmlConfigurationProvider.java:180) ... 24 more What is the reason for this?I have checked whether I have loaded same jar double times,but tht's not tht problem.what might b the reason?Does any body came across this one? Also,the link: http://www.roseindia.net/struts/hibernate-spring/integrate.shtml helps in integrating struts1+hibernate+springs.But, since I would like to work with struts2+Hibernate+Spring,what modifications I have to do to satisfy my requirement?Since action forms concept is not there in struts2...!!! Thanks. -- View this message in context: http://www.nabble.com/struts2%2BSpring%2BHibernate-Integration-tp15607260p15 607260.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/struts2%2BSpring%2BHibernate-Integration-tp15607260p15715059.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]
HOw to send form parameters to dao in struts2 with hibernate?
Hi, By implementing Preparable,ModelDriven,ServletRequestAware interfaces,am able to get the form details and sent those details to service implementation layer from an action class.From service implementation i have called dao.Since DAO is not injected any where in struts.xml,its throwing nullpointerexception.I have used only hibernate.Is it required to use springs inorder to inject dao?Or,can I inject using hibernate and struts2 alone?? And what is the use of interceptor concept?Does it help to do dao injection without using spring?If so,how to use it? Plzzz reply as early as possible... Thanks. -- View this message in context: http://www.nabble.com/HOw-to-send-form-parameters-to-dao-in-struts2-with-hibernate--tp15730459p15730459.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 connection pooling using MySQL
Hi, As struts2 comes along with spring integration with struts2-spring-plugin-2.0.11.jar,after starting the tomcat server its unable to load that jar and getting an exception as: SEVERE: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/E:/Struts2WorkSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SampleStruts2/WEB-INF/lib/struts2-spring-plugin-2.0.11.jar!/struts-plugin.xml:30:132 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208) at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:79) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3540) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4110) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) 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:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1629) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:850) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1299) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181) at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:139) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:180) ... 24 more What is the reason for this?I have checked whether I have loaded same jar double times,but tht's not tht problem?what might b the reason?Does any body came across this one? Also,the link: http://www.roseindia.net/struts/hibernate-spring/integrate.shtml helps in integrating struts1+hibernate+springs.But, since I would like to work with struts2+Hibernate+Spring,what modifications I have to do to satisfy my requirement?Since ation forms concept is not there in struts2...!!! Thanks. RajiR wrote: Ok,,thx for the repliesi'll try using JNDI and with spring integration.I have worked using struts2+hibernate,it works fine.. Laurie Harper wrote: Struts1 provided a data-source configuration
struts2+Spring+Hibernate Integration
Hi, As struts2 comes along with spring integration with struts2-spring-plugin-2.0.11.jar,after starting the tomcat server its unable to load that jar and getting an exception as: SEVERE: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/E:/Struts2WorkSpace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SampleStruts2/WEB-INF/lib/struts2-spring-plugin-2.0.11.jar!/struts-plugin.xml:30:132 . Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware at java.lang.ClassLoader.defineClass1(Native Method) ..com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:180) ... 24 more What is the reason for this?I have checked whether I have loaded same jar double times,but tht's not tht problem.what might b the reason?Does any body came across this one? Also,the link: http://www.roseindia.net/struts/hibernate-spring/integrate.shtml helps in integrating struts1+hibernate+springs.But, since I would like to work with struts2+Hibernate+Spring,what modifications I have to do to satisfy my requirement?Since action forms concept is not there in struts2...!!! Thanks. -- View this message in context: http://www.nabble.com/struts2%2BSpring%2BHibernate-Integration-tp15607260p15607260.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 connection pooling using MySQL
Hi All, Since struts1 has connection pooling mechanism using data-source/ tag,what is the procedure of connection pooling mechanism in struts2? Can we do tht using bean class=/ tag?I have seen from some of the search results for oracle db using class:oracle.jdbc.pool.OracleConnectionCacheImpl. But I need to connect to MySQL database,how to implement connection pooling in struts.xml for mysql database? Please reply as soon as possible. Thanks. -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15584715.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 connection pooling using MySQL
Can't we implement connection pooling in struts2 alone?If so ,may I know the reason please...!!! Thanks. nuwan chandrasoma-2 wrote: Hi, Why do not you give a try with Spring. as struts2 has built in support for spring, you can use springs connection pooling very easily. Thanks, Nuwan. RajiR wrote: Hi All, Since struts1 has connection pooling mechanism using data-source/ tag,what is the procedure of connection pooling mechanism in struts2? Can we do tht using bean class=/ tag?I have seen from some of the search results for oracle db using class:oracle.jdbc.pool.OracleConnectionCacheImpl. But I need to connect to MySQL database,how to implement connection pooling in struts.xml for mysql database? Please reply as soon as possible. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15586219.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 connection pooling using MySQL
Hi, In this link : http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html, we can preform connection pooling only after configuring it in our configuration files.If it is in the case of struts1, struts-config.xml file has a tag called data-source/ and there we can configure.But,what about struts2 how can we configure in its configuration file(struts.xml)?I think only after configuring in the configuration file(for eg., struts.xml in the case of struts2),we can use the connection pool using a java program as it is explained in the link provided by you.So the problem is with how to configure the pool in the struts.xml?I think I am clear...!! Thanks. Jeromy Evans - Blue Sky Minds wrote: RajiR wrote: Can't we implement connection pooling in struts2 alone?If so ,may I know the reason please...!!! Thanks. Struts 2 itself doesn't provide a connection pooling implementation and probably shouldn't. MySql provide a pooled DataSource that you can use immediately. Set it up the same way as your current DataSource http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html Does that help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15586542.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 connection pooling using MySQL
Ok,,thx for the repliesi'll try using JNDI and with spring integration.I have worked using struts2+hibernate,it works fine.. Laurie Harper wrote: Struts1 provided a data-source configuration element because, at the time that was added, there was no consistent mechanism for configuring data sources that worked across servlet containers. That changed a long time ago and Struts first deprecated, and then removed, its support for the data-source configuration element. The preferred way to set up a data source (using a connection pool or not) is through JNDI using your servlet container configuration. The article Jeromy linked to mentions JNDI and links to more detailed documentation for various servlet containers and application servers. In short: 1) configure a data source (connection pool) and expose it via JNDI, using your servlet container or application server as described in the documentation linked from that article; 2) modify any code you have that uses a data source (connection pool) to obtain it from JNDI, using the code in that article You don't need Struts2 to be able to do this for you, as there are standard mechanisms you can use instead. Of course the prior reference to Spring is a good one to look into since Spring provides all sorts of help in configuring and using data sources and the database beneath them :-) L. RajiR wrote: Hi, In this link : http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html, we can preform connection pooling only after configuring it in our configuration files.If it is in the case of struts1, struts-config.xml file has a tag called data-source/ and there we can configure.But,what about struts2 how can we configure in its configuration file(struts.xml)?I think only after configuring in the configuration file(for eg., struts.xml in the case of struts2),we can use the connection pool using a java program as it is explained in the link provided by you.So the problem is with how to configure the pool in the struts.xml?I think I am clear...!! Thanks. Jeromy Evans - Blue Sky Minds wrote: RajiR wrote: Can't we implement connection pooling in struts2 alone?If so ,may I know the reason please...!!! Thanks. Struts 2 itself doesn't provide a connection pooling implementation and probably shouldn't. MySql provide a pooled DataSource that you can use immediately. Set it up the same way as your current DataSource http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html Does that help? - 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] -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15587014.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]