[
https://issues.apache.org/jira/browse/TAPESTRY-1898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541477
]
Ezra Epstein commented on TAPESTRY-1898:
----------------------------------------
Hey Howard,
Thank much for correcting my attempt to guess what's under the covers. And
thanks for the fix. I'll try it...
OK, that was easy and, yup, it worked.
> Leaky Framework: cannot implement a method named 'getServlerContext()' on a
> Page component
> ------------------------------------------------------------------------------------------
>
> Key: TAPESTRY-1898
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1898
> Project: Tapestry
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.0.6
> Environment: JDK 1.6
> Windows XP
> Reporter: Ezra Epstein
>
> Leaky Framework: cannot implement a method named 'getServlerContext()' on a
> Page component.
> I've got a page that's working fine. Was getting the ServletContext via an
> injected ApplicationGlobals and using the ApplicationGlobals within methods
> that needed the ServletContext. Started to be a few methods needed it so I
> created a simple convenience method:
> @Inject
> @Service("ApplicationGlobals")
> private ApplicationGlobals applicationGlobals;
> protected ServletContext getServletContextObj() {
> return (applicationGlobals == null ? null :
> applicationGlobals.getServletContext());
> }
> And:
> org.apache.tapestry.internal.services.TransformationException
>
> StackMapTable format error: bad class index
> transformation
> InternalClassTransformation[
> public com.bar.baf.pages.UploadClip extends java.lang.Object
> implements org.apache.tapestry.runtime.Component,
> org.apache.tapestry.runtime.RenderCommand
> add default method: public void postRenderCleanup()
> <default>
> add default method: public void setupRender(org.apache.tapestry.MarkupWriter
> $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beginRender(org.apache.tapestry.MarkupWriter
> $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void
> beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1,
> org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void
> afterRenderTemplate(org.apache.tapestry.MarkupWriter $1,
> org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void
> beforeRenderBody(org.apache.tapestry.MarkupWriter $1,
> org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void
> afterRenderBody(org.apache.tapestry.MarkupWriter $1,
> org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRender(org.apache.tapestry.MarkupWriter
> $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void
> cleanupRender(org.apache.tapestry.MarkupWriter $1,
> org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public boolean
> handleComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
> <default>
> add default method: public org.apache.tapestry.ComponentResources
> getComponentResources()
> <default>
> add default method: public void containingPageDidLoad()
> <default>
> add default method: public void containingPageDidDetach()
> <default>
> add default method: public void containingPageDidAttach()
> <default>
> add field: protected final
> org.apache.tapestry.internal.InternalComponentResources _$resources;
> replace method: public final org.apache.tapestry.ComponentResources
> getComponentResources()
> return _$resources
> ...
> Turns out that getServletContext() is "reserved" by Tapestry. I tried
> protected abstract ServletContext getServletContext();
> But no dice.
> Work-around: changed the name of the method. That worked. Downside: the
> getServletContext() method name is the obvious /desirable one.
> Suggestion: Prefer to have Tapestry not take over method names. If it must,
> prefer to give them scoped names that aren't likely to be used by regular
> apps. E.g., get/setTap5Foo (in general) and getTap5ServletContext() (in
> particular).
> Thanks.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]