<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Spring JDBC Template &#8211; A leaner alternative to fat Hibernate</title>
	<atom:link href="http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328</link>
	<description></description>
	<lastBuildDate>Sun, 22 Jan 2012 04:28:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1116</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Sat, 12 Nov 2011 13:36:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1116</guid>
		<description>Very nice :)) When I use json.POJO Mapping . I get this error : http://stackoverflow.com/questions/5161466/how-do-i-use-the-jersey-json-pojo-support , so I commented that part out. It maps all my pojos to json perfectly fine without it. So I don&#039;t know why exactly I need it. 
When I load the beans from applicationContext.xml they usually print out some of the things they do in the tomcat console (like when c3p0 created its connection pool).  But this doesn&#039;t happen. Hm? 
And to actually use the beans I also created a common class like that.

public class Common {

	private static ApplicationContext context;

	public static ApplicationContext getContext() {
		if (context == null) {
			context = new FileSystemXmlApplicationContext(
					&quot;classpath:applicationContext.xml&quot;);
			return context;
		}
		return context;
	}
}

which actually seems to create the beans when from the applicationContext when i call it. 
I would really like even the first call of my webservice to use those already created beans.
Am I doing something wrong? :)
Thanks a lot for the help!</description>
		<content:encoded><![CDATA[<p>Very nice <img src='http://www.wetfeetblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) When I use json.POJO Mapping . I get this error : <a href="http://stackoverflow.com/questions/5161466/how-do-i-use-the-jersey-json-pojo-support" rel="nofollow">http://stackoverflow.com/questions/5161466/how-do-i-use-the-jersey-json-pojo-support</a> , so I commented that part out. It maps all my pojos to json perfectly fine without it. So I don&#8217;t know why exactly I need it.<br />
When I load the beans from applicationContext.xml they usually print out some of the things they do in the tomcat console (like when c3p0 created its connection pool).  But this doesn&#8217;t happen. Hm?<br />
And to actually use the beans I also created a common class like that.</p>
<p>public class Common {</p>
<p>	private static ApplicationContext context;</p>
<p>	public static ApplicationContext getContext() {<br />
		if (context == null) {<br />
			context = new FileSystemXmlApplicationContext(<br />
					&#8220;classpath:applicationContext.xml&#8221;);<br />
			return context;<br />
		}<br />
		return context;<br />
	}<br />
}</p>
<p>which actually seems to create the beans when from the applicationContext when i call it.<br />
I would really like even the first call of my webservice to use those already created beans.<br />
Am I doing something wrong? <img src='http://www.wetfeetblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thanks a lot for the help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas Mazukna</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1115</link>
		<dc:creator>Tomas Mazukna</dc:creator>
		<pubDate>Fri, 11 Nov 2011 13:12:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1115</guid>
		<description>You need to use spring specific jersey servlet ;)
Here is what I have used in the past:

	&lt;context-param&gt;
		&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
		&lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;
	&lt;/context-param&gt;
    
	&lt;listener&gt;
		&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
	&lt;/listener&gt;

       
    &lt;servlet&gt;
        &lt;servlet-name&gt;archetype-api&lt;/servlet-name&gt;
        &lt;servlet-class&gt;com.sun.jersey.spi.spring.container.servlet.SpringServlet&lt;/servlet-class&gt;
        &lt;init-param&gt;
            &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
            &lt;param-value&gt;Your.package.name.for.rest.resources&lt;/param-value&gt;
        &lt;/init-param&gt;
 		&lt;init-param&gt;
 			&lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt;
			&lt;param-value&gt;true&lt;/param-value&gt;
		&lt;/init-param&gt;
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;

all spring beans where defined in applicationContext.xml found on the classpath. I used Json pojo marshaling feature.</description>
		<content:encoded><![CDATA[<p>You need to use spring specific jersey servlet <img src='http://www.wetfeetblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Here is what I have used in the past:</p>
<p>	&lt;context-param&gt;<br />
		&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />
		&lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;<br />
	&lt;/context-param&gt;</p>
<p>	&lt;listener&gt;<br />
		&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br />
	&lt;/listener&gt;</p>
<p>    &lt;servlet&gt;<br />
        &lt;servlet-name&gt;archetype-api&lt;/servlet-name&gt;<br />
        &lt;servlet-class&gt;com.sun.jersey.spi.spring.container.servlet.SpringServlet&lt;/servlet-class&gt;<br />
        &lt;init-param&gt;<br />
            &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;<br />
            &lt;param-value&gt;Your.package.name.for.rest.resources&lt;/param-value&gt;<br />
        &lt;/init-param&gt;<br />
 		&lt;init-param&gt;<br />
 			&lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt;<br />
			&lt;param-value&gt;true&lt;/param-value&gt;<br />
		&lt;/init-param&gt;<br />
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />
    &lt;/servlet&gt;</p>
<p>all spring beans where defined in applicationContext.xml found on the classpath. I used Json pojo marshaling feature.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1114</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Fri, 11 Nov 2011 08:01:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1114</guid>
		<description>Ok, it seems it doesn&#039;t like my xml here, but the structure is the same as in the tutorial i followed. here is a closer link: http://www.vogella.de/articles/REST/article.html#first_servletdispatcher</description>
		<content:encoded><![CDATA[<p>Ok, it seems it doesn&#8217;t like my xml here, but the structure is the same as in the tutorial i followed. here is a closer link: <a href="http://www.vogella.de/articles/REST/article.html#first_servletdispatcher" rel="nofollow">http://www.vogella.de/articles/REST/article.html#first_servletdispatcher</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1113</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Fri, 11 Nov 2011 07:59:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1113</guid>
		<description>Here is my web.xml configuration



	CabbieMagnet
	
		Jersey REST Service
		com.sun.jersey.spi.container.servlet.ServletContainer
		
			com.sun.jersey.config.property.packages
			com.cabbiemagnet.webservices
		
		1
	
	
		Jersey REST Service
		/rest/*
	
	

	
		index.html
		index.htm
		index.jsp
		default.html
		default.htm
		default.jsp
	


i followed the tutorial from here: http://www.vogella.de/articles/REST/article.html</description>
		<content:encoded><![CDATA[<p>Here is my web.xml configuration</p>
<p>	CabbieMagnet</p>
<p>		Jersey REST Service<br />
		com.sun.jersey.spi.container.servlet.ServletContainer</p>
<p>			com.sun.jersey.config.property.packages<br />
			com.cabbiemagnet.webservices</p>
<p>		1</p>
<p>		Jersey REST Service<br />
		/rest/*</p>
<p>		index.html<br />
		index.htm<br />
		index.jsp<br />
		default.html<br />
		default.htm<br />
		default.jsp</p>
<p>i followed the tutorial from here: <a href="http://www.vogella.de/articles/REST/article.html" rel="nofollow">http://www.vogella.de/articles/REST/article.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas Mazukna</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1112</link>
		<dc:creator>Tomas Mazukna</dc:creator>
		<pubDate>Thu, 10 Nov 2011 01:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1112</guid>
		<description>Post your servlet definitions section of the web.xml. Answer depends on the implementation you are using.</description>
		<content:encoded><![CDATA[<p>Post your servlet definitions section of the web.xml. Answer depends on the implementation you are using.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1111</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Thu, 10 Nov 2011 01:10:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1111</guid>
		<description>It is fine, I got it up and running. Thanks a lot!!! But now all the beans are loaded when a service is called and it can be seen visually that the first call is waaay slower than the next ones. (everything is created at that time)
Sorry if the questions are noobish, but i&#039;m kinda new to this. Thanks.</description>
		<content:encoded><![CDATA[<p>It is fine, I got it up and running. Thanks a lot!!! But now all the beans are loaded when a service is called and it can be seen visually that the first call is waaay slower than the next ones. (everything is created at that time)<br />
Sorry if the questions are noobish, but i&#8217;m kinda new to this. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1110</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Wed, 09 Nov 2011 22:56:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1110</guid>
		<description>Could the file be specified in the web.xml?</description>
		<content:encoded><![CDATA[<p>Could the file be specified in the web.xml?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1109</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Wed, 09 Nov 2011 22:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1109</guid>
		<description>It is actually a web application using RESTful architecture and I am a bit confused where exactly to put that line to specify the Application Context. I have several classes for different services. It definitely can&#039;t be in one, but which :/</description>
		<content:encoded><![CDATA[<p>It is actually a web application using RESTful architecture and I am a bit confused where exactly to put that line to specify the Application Context. I have several classes for different services. It definitely can&#8217;t be in one, but which :/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas Mazukna</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1108</link>
		<dc:creator>Tomas Mazukna</dc:creator>
		<pubDate>Wed, 09 Nov 2011 01:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1108</guid>
		<description>If you are not running a web application, you can init spring application context like this in your main() method:

ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {&quot;applicationContext.xml&quot;, &quot;applicationContext-part2.xml&quot;});

or 

ApplicationContext context = new FileSystemXmlApplicationContext(new String[] {&quot;applicationContext.xml&quot;, &quot;applicationContext-part2.xml&quot;});

Tomas</description>
		<content:encoded><![CDATA[<p>If you are not running a web application, you can init spring application context like this in your main() method:</p>
<p>ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {&#8220;applicationContext.xml&#8221;, &#8220;applicationContext-part2.xml&#8221;});</p>
<p>or </p>
<p>ApplicationContext context = new FileSystemXmlApplicationContext(new String[] {&#8220;applicationContext.xml&#8221;, &#8220;applicationContext-part2.xml&#8221;});</p>
<p>Tomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.wetfeetblog.com/spring-jdbc-template-leaner-alternative-fat-hibernate/328/comment-page-1#comment-1107</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Wed, 09 Nov 2011 01:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=328#comment-1107</guid>
		<description>Hi there. A great overview!
I got to work with c3p0 but so far only setting it up from the java class. 
I use the Spring JDBC layer but so far couldn&#039;t manage to use an XML configuration for Spring.

I search over the internet for that, but nobody seems to mention how to setup this. 
I use spring.framework jars only including them to my classpath so nothing is generated automatically with any applicationContext.xml or anything.

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi there. A great overview!<br />
I got to work with c3p0 but so far only setting it up from the java class.<br />
I use the Spring JDBC layer but so far couldn&#8217;t manage to use an XML configuration for Spring.</p>
<p>I search over the internet for that, but nobody seems to mention how to setup this.<br />
I use spring.framework jars only including them to my classpath so nothing is generated automatically with any applicationContext.xml or anything.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

