<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: spring code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 12 Oct 2008 09:50:20 GMT</pubDate>
    <description>DZone Snippets: spring code</description>
    <item>
      <title>How to get a parameter from the RequestContext in Spring</title>
      <link>http://snippets.dzone.com/posts/show/5343</link>
      <description>// How to get a parameter from the org.springframework.webflow.execution.RequestContext in Spring framework&lt;br /&gt;&lt;br /&gt;// Java:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;String myParameter = context.getExternalContext().getRequestParameterMap().get("myParameterPath");&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;// JSP:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;form:select path="myParameterPath" id="myParameterId"&gt;&lt;br /&gt;    ...&lt;br /&gt;&lt;/form:select&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;// HTML rendered as:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;select name="myParameterPath" id="myParameterId"&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 10 Apr 2008 07:53:10 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5343</guid>
      <author>gasull2 (dgasull)</author>
    </item>
    <item>
      <title>spring &#24212;&#29992;&#20013;&#28155;&#21152;log4j &#37197;&#32622;</title>
      <link>http://snippets.dzone.com/posts/show/4927</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;!-- &#23450;&#20041;&#19968;&#20010;key name, &#36825;&#20010;key name &#22312;&#36816;&#34892;&#26102;&#25351;&#21521;&#24403;&#21069;web app&#30340;&#26681;&#30446;&#24405; ---&gt;&lt;br /&gt;  &lt;context-param&gt;&lt;br /&gt;		&lt;param-name&gt;webAppRootKey&lt;/param-name&gt;&lt;br /&gt;		&lt;param-value&gt;petstore.root&lt;/param-value&gt;&lt;br /&gt;  &lt;/context-param&gt;&lt;br /&gt;  &lt;!-- &#23450;&#20041;&#19968;&#20010;log4j &#37197;&#32622;&#25991;&#20214;&#30340;&#36335;&#24452;&#21517;&#31216; --&gt;&lt;br /&gt;  &lt;context-param&gt;&lt;br /&gt;		&lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt;&lt;br /&gt;		&lt;param-value&gt;/WEB-INF/log4j.properties&lt;/param-value&gt;&lt;br /&gt;  &lt;/context-param&gt;&lt;br /&gt;  &lt;!-- &#20351;&#29992;listener &#37197;&#32622; log4j  --&gt;&lt;br /&gt;  &lt;listener&gt;&lt;br /&gt;		&lt;listener-class&gt;org.springframework.web.util.Log4jConfigListener&lt;/listener-class&gt;&lt;br /&gt;  &lt;/listener&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 26 Dec 2007 09:15:09 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4927</guid>
      <author>yuanyc (yuanyunchang)</author>
    </item>
    <item>
      <title>testing new bean scopes with spring 2.0 - example</title>
      <link>http://snippets.dzone.com/posts/show/3001</link>
      <description>// scoped bean definition&lt;br /&gt;&lt;code&gt;&lt;br /&gt;	&lt;bean id="scopedBean"&lt;br /&gt;		class="org.bla.ScopedBeanImpl"&lt;br /&gt;		scope="session"&gt;&lt;br /&gt;		&lt;aop:scoped-proxy /&gt;&lt;br /&gt;	&lt;/bean&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;// an example test case&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public class ScopedBeanTest extends AbstractRequestContextFilterTestBase {&lt;br /&gt;&lt;br /&gt;	protected String[] getConfigLocations() {&lt;br /&gt;		return new String[] { "classpath:applicationContext-with-scopedBean.xml" };&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	@Test&lt;br /&gt;	public void testScopedBean() throws Exception {&lt;br /&gt;&lt;br /&gt;		new FilterTest(new FilterChain() {&lt;br /&gt;&lt;br /&gt;			public void doFilter(ServletRequest arg0, ServletResponse arg1)&lt;br /&gt;					throws IOException, ServletException {&lt;br /&gt;				ScopedBean scopedBean = (ScopedBean) applicationContext&lt;br /&gt;						.getBean("scopedBean");&lt;br /&gt;				...&lt;br /&gt;				/* &lt;br /&gt;				 * let the classses under test do something with your scopedBean&lt;br /&gt;				 * and check if modifications are done correctly &lt;br /&gt;				 */&lt;br /&gt;				...&lt;br /&gt;			}&lt;br /&gt;&lt;br /&gt;		}).run();&lt;br /&gt;&lt;br /&gt;	}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 15 Nov 2006 18:15:01 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3001</guid>
      <author>awurzer (Andreas Wurzer)</author>
    </item>
    <item>
      <title>ProxyFactoryBean</title>
      <link>http://snippets.dzone.com/posts/show/2464</link>
      <description>Use of spring 's ProxyFactoryBean&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;  &lt;bean id="abstractDaoTarget"&lt;br /&gt;        class="com.dao.impl.GenericDaoHibernateImpl" abstract="true"&gt;&lt;br /&gt;    &lt;property name="sessionFactory"&gt;&lt;br /&gt;      &lt;ref bean="sessionFactory"/&gt;&lt;br /&gt;    &lt;/property&gt;&lt;br /&gt;  &lt;/bean&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;bean id="abstractDao"&lt;br /&gt;        class="org.springframework.aop.framework.ProxyFactoryBean" abstract="true"&gt;&lt;br /&gt;    &lt;property name="interceptorNames"&gt;&lt;br /&gt;      &lt;list&gt;&lt;br /&gt;        &lt;value&gt;finderIntroductionAdvisor&lt;/value&gt;&lt;br /&gt;      &lt;/list&gt;&lt;br /&gt;    &lt;/property&gt;&lt;br /&gt;  &lt;/bean&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;bean id="dao" abstract="true"&gt;&lt;br /&gt;    &lt;property name="sessionFactory"&gt;&lt;br /&gt;      &lt;ref bean="sessionFactory"/&gt;&lt;br /&gt;    &lt;/property&gt;&lt;br /&gt;  &lt;/bean&gt;&lt;br /&gt;    &lt;br /&gt;  &lt;bean id="someDao" parent="abstractDao"&gt;&lt;br /&gt;    &lt;property name="proxyInterfaces"&gt;&lt;br /&gt;      &lt;value&gt;com.dao.SomeDao&lt;/value&gt;&lt;br /&gt;    &lt;/property&gt;&lt;br /&gt;    &lt;property name="target"&gt;&lt;br /&gt;      &lt;bean parent="abstractDaoTarget"&gt;&lt;br /&gt;        &lt;constructor-arg&gt;&lt;br /&gt;          &lt;value&gt;com.domain.SomeBean&lt;/value&gt;&lt;br /&gt;        &lt;/constructor-arg&gt;&lt;br /&gt;      &lt;/bean&gt;&lt;br /&gt;    &lt;/property&gt;&lt;br /&gt;  &lt;/bean&gt;&lt;br /&gt;  &lt;/code&gt;</description>
      <pubDate>Thu, 24 Aug 2006 09:24:15 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2464</guid>
      <author>pokemon (pokemon)</author>
    </item>
  </channel>
</rss>
