Description
I have a page with a property defined as such:
<property name="query" initial-value="spring('resourceQuery')" />
This was my simple way to inject Spring services in 3.0 pages. This just uses the requestcycle to get access to the ServletContext and look up the named bean in the Spring Context associated with the ServletContext. Unfortunately it looks like AbstractPage.getRequestCycle() is returning null when the page is being constructed.
java.lang.NullPointerException
- com.webify.framework.bsc.BscPage.getCurrentServletContext(BscPage.java:145)
- com.webify.framework.bsc.BscPage.getSpringContext(BscPage.java:137)
- com.webify.framework.bsc.BscPage.spring(BscPage.java:66)
- sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
- sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
- sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
- java.lang.reflect.Method.invoke(Method.java(Compiled Code))
- ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
- ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:785)
- ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:61)
- ognl.OgnlRuntime.callMethod(OgnlRuntime.java:819)
- ognl.ASTMethod.getValueBody(ASTMethod.java:75)
- ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
- ognl.SimpleNode.getValue(SimpleNode.java:210)
- ognl.Ognl.getValue(Ognl.java:333)
- ognl.Ognl.getValue(Ognl.java:310)
- org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.readCompiled(ExpressionEvaluatorImpl.java:91)
- $ExpressionEvaluator_107a1397f6e.readCompiled($ExpressionEvaluator_107a1397f6e.java)
- org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:110)
- org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:103)
- org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:87)
- $SearchPage_25.finishLoad($SearchPage_25.java)
- org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.java:424)
- org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:593)
- $IPageLoader_107a1397f01.loadPage($IPageLoader_107a1397f01.java)
- $IPageLoader_107a1397f02.loadPage($IPageLoader_107a1397f02.java)
- org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:118)
- $IPageSource_107a1397e6d.getPage($IPageSource_107a1397e6d.java)
- org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:265)
- org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:248)
- org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:609)