Hi, In our app we use both: <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> in web.xml The beans config looks like: <bean id="bean" class="com.example.Bean" scope="request"> <aop:scoped-proxy/> </bean> and both request and session scoped beans work fine. On Mon, Jul 8, 2013 at 10:07 AM, Alexey Mukas <alexey.mu...@gmail.com>wrote: > Hi Martin, > > Here is bean config: > <?xml version="1.0" encoding="UTF-8"?> > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd"> > <bean class="com.mycompany.TestClass" > scope="request"> > </bean> > </beans> > > Java def: > public class TestClass implements Serializable{ > private static final long serialVersionUID = 2746134459017523678L; > public String name; > > public String getName() { > return name; > } > > public void setName(String name) { > this.name = name; > } > } > > Init: > @Override > public void init() > { > super.init(); > getComponentInstantiationListeners().add(new > SpringComponentInjector(this, > new ClassPathXmlApplicationContext("SpringConfig.xml"))); > } > > Quickstart: > https://mega.co.nz/#!uR0lQKSD!LzrUs1NWpcLJpkrSkK1WMlRT4NQ6JH7A85j4m7hZbjA > > Adding <aop:scoped-proxy/> to the bean config didn't help too. > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Spring-cannot-inject-bean-with-scope-request-session-tp4660112p4660139.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >