Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Web Resource works in local standalone server but not on production server

Deleted user June 21, 2011

I am having trouble with a web resource not downloading (Firebug doesn't show it in the list of css files)

<web-resource name="VNC Anonymous Styles" key="vnc_anon_styles">
<description>Performs the hiding of various elements for users who are not logged in, but are still authorized to view the content.</description>
<resource name="vnc_anon.css" type="download" location="vnc_anon.css" />
</web-resource>

In my servlet filter (which identifies anonymous users correctly) I have the following line, which is working on the standalone development server, but not on the "live" server I upload the plugin to:

_wrm.requireResource("com.veson.confluence.plugin.vnc_custom:vnc_anon_styles");

(_wrm) is the webResourceManager that gets injected.

Any idea why it works on the dev server (using atlas-run) and not the live server (uploaded through Confluence Admin)?

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Stefan Kleineikenscheidt _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2011

On a production server, the CSS and JS files defined in atlassian-plugin.xml are batched, so save delivery time. More Info here: http://confluence.atlassian.com/display/CONFDEV/Web+Resource+Module#WebResourceModule-BatchedMode

Is this what you are experiencing?

Deleted user June 27, 2011

What I was exeriencing was that at the after-encoding portion of the filter process, and by the time I would reach the before-dispatch step, the requirement I set would be gone. If I restated the requirement in the before-dispatch step, the css file would be downloaded to the browser. (It may show up as well in earlier steps, I just went with the solution that worked).

0 votes
Deleted user June 22, 2011

I was able to get the requirement satisfied by adding another class later on in the filter chain. The first filter with a location of after-encoding sets a session variable for the later one to use. Then the second filter, which has a location of before-dispatch, checks the session variable and performs the resourceRequirement() as appropriate.

It appears as if requirements dissappear at some point in the filter chain??

Deleted user June 26, 2011

Also note:

When changing the first filter to before-dispatch it was still able to perform its authentication when needed, and eliminated the need for the second plugin to inject the CSS.

At some point in the filtering chain, resources must be getting cleared out by one of the packaged filters. (Confluence 3.4.8)

TAGS
AUG Leaders

Atlassian Community Events