if you have Spring you can put it anywhere you want 
/** app context. */
private static 
org.springframework.context.support.ClassPathXmlApplicationContext.appContext;
YourClassName.appContext = new 
org.springframework.context.support.ClassPathXmlApplicationContext("conf/applicationContext.xml");

org.springframework.context.ApplicationContextcontext=(org.springframework.context.ApplicationContext)
 YourClassName.appContext;

*gruss*
Martin
______________________________________________ 
                                                                                
                   


> Date: Sun, 30 Aug 2015 02:48:07 +0530
> Subject: Re: Where to put context.xml in webapp archetype ?
> From: sreyan.mail...@gmail.com
> To: users@maven.apache.org
> 
> A little bit of update. You have to put context.xml in
> 
> src/main/webapp/META-INF/context.xml
> 
> not directly under the WEB-INF folder.
> 
> On Sat, Aug 8, 2015 at 6:38 PM, jieryn <jie...@gmail.com> wrote:
> 
> > I personally find this a bit weird, but it's because the JPA
> > persistence.xml needs to end up in
> > war!WEB-INF/classes/META-INF/persistence.xml whereas Tomcat will
> > expect to find context.xml in war!WEB-INF/context.xml. I suppose you
> > could put it in
> > src/main/webapp/WEB-INF/classes/META-INF/persistence.xml but then IDEs
> > will probably not find it easily/at all.
> >
> > Glad it works for you.
> >
> > On Sat, Aug 8, 2015 at 8:47 AM, Sreyan Chakravarty
> > <sreyan.mail...@gmail.com> wrote:
> > > Thanks
> > >
> > > On Sat, Aug 8, 2015 at 4:05 PM, jieryn <jie...@gmail.com> wrote:
> > >
> > >> src/main/resources/META-INF/persistence.xml
> > >> src/main/webapp/WEB-INF/context.xml
> > >>
> > >> On Fri, Aug 7, 2015 at 3:24 PM, Sreyan Chakravarty
> > >> <sreyan.mail...@gmail.com> wrote:
> > >> > I am using Maven for building a simple webapp that uses JDBC
> > connection
> > >> > pooling along with Hibernate.
> > >> >
> > >> > I am using the Maven Webapp Archetype to build the project.
> > >> >
> > >> > Where do I put context.xml and persistence.xml that I normally put
> > under
> > >> > META-INF in a normal dynamic web project.
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > >> For additional commands, e-mail: users-h...@maven.apache.org
> > >>
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
                                          

Reply via email to