Should this example work with Confluence?
I get an NPE at com.opensymphony.xwork.util.TextParseUtil.translateVariables(TextParseUtil.java:28) and my getInputStream method is never invoked.
Community moderators have prevented the ability to post new answers.
Hi Steve,
Confluence uses WebWork v1 (WebWork before it was merged with Struts), so some parts of the Apache Struts documentation will not apply to WebWork in Confluence.
If you have access to Confluence's source code (which you can get as a commercial/academic/starter license holder), you can see all the available WebWork result types by looking at Confluence's xwork.xml:
<package name="default"> <result-types> <result-type name="dispatcher" class="com.opensymphony.webwork.dispatcher.ServletDispatcherResult"/> <result-type name="stream" class="com.opensymphony.webwork.dispatcher.StreamResult"/> <result-type name="redirect" class="com.atlassian.confluence.xwork.RedirectResult"/> <result-type name="redirectwithflash" class="com.atlassian.confluence.xwork.RedirectWithFlashResult"/> <result-type name="velocity" class="com.atlassian.confluence.setup.webwork.EncodingVelocityResult"/> <result-type name="velocity-xml" class="com.atlassian.xwork.results.XmlVelocityResult"/> <result-type name="velocity-css" class="com.atlassian.xwork.results.CSSVelocityResult"/> <result-type name="httpheader" class="com.opensymphony.webwork.dispatcher.HttpHeaderResult"/> <result-type name="chain" class="com.opensymphony.xwork.ActionChainResult"/> <result-type name="rawText" class="com.atlassian.confluence.setup.webwork.RawTextResult"/> <result-type name="rss" class="com.atlassian.xwork.results.RssResult"/> <result-type name="json" class="com.atlassian.confluence.json.JsonResult"/> </result-types>
Oh, sorry. I see that we do indeed support the "stream" result.
Let me see if I can get it work locally.
Also, make sure that your action class extends ConfluenceActionSupport, not ActionSupport.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, if you just want to return raw text, and are not especially interested in doing this in a "streaming" fashion, just use the RawTextResult.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, I'll look into RawTextResult. I've also been experimenting with the json result and that looks suitable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See also: How to return a file from an Action?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.