Accessing HTTP parameters from a Confluence Web Item

Is there any way to access the underlying HTTP request when creating a web-panel. According to the documentation you need to extend a JIRA only class, which is clearly incorrect (and didn't compile).

The only class available for the context provider is com.atlassian.plugin.web.ContextProvider and

public Map<String, Object> getContextMap(Map<String, Object> context)

but this doesn't seem to have anything in the context which would let you figure out things like the HTTP request parameters.

I can't believe that web panels are fully featured in JIRA, but stunted in Confluence.

2 answers

0 vote
Aleksandr Zuevich Community Champion Aug 13, 2017

Hi Daniel,

try to use ServletActionContext.getRequest() to get the HttpServletRequest and then getParameter(paramName).

I thought of that as well, but ServletActionContext.getRequest() returns a null object.

0 vote
Aleksandr Zuevich Community Champion Aug 14, 2017

Ok, how is your action described in atlassian-plugin.xml? You can use web-item and xwork elements and extends ConfluenceActionSupport in your action class. It'll allow you to invoke getCurrentRequest() method.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

915 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you