On Sun, Oct 6, 2013 at 5:51 PM, Paul Libbrecht <paul(a)hoplahup.net> wrote:
I would have preferred to write into the xwiki context
if I could. But I have not found a way for a filter to be wired in a way that can get the
xwiki context. Would there be one?
The context is created by the Struts Servlet (XWikiAction.java) so it does not exist yet
when your filter runs. One solution is to move the xwiki context initialization code from
XWikiAction to a filter that runs before your filter. We should do this in the platform
ideally since it could be useful. You could create a jira issue about it.
Well, our web.xml actually seems to include such a
thing org.xwiki.wysiwyg.server.filter.XWikiContextInitializationFilter but I could not
read in the source how its output would be profitable to other filters.
This was made for servlets other than the action servlet which is the
main servlet serving wiki pages and which initializes itself the
context. It is used currently by REST and GWT-RPC servlets. It creates
a fake XWiki context (fake because a REST request or a GWT-RPC request
doesn't have all the information a /bin/view/ request has for
instance) so it wasn't made to be used with the action servlet (that's
why this filter is not mapped to the action servlet in web.xml).
Hope this helps,
Marius
(I expected something such as a thread-local).
paul
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs