Reputation: 597076
MyFaces Orchestra adds a ?conversationContext=x
to each resource on a page. Since I'm not using the conversation scope for the public part of my project (only for the admin part), I'd like to get rid of that parameter for two reasons:
I'm now going to take a look at Orchestra's source-code, and perhaps bypass something, but it would be best if there is an option for this I'm unaware of
Upvotes: 4
Views: 810
Reputation: 597076
The answer to that question is simple, and at the same time a bit of a workaround.
MyFaces orchestra uses a wrapper around the original HttpServletResponse
in order to encode the contesationContext
parameter.
There are two options of using Orchestra - with an interceptor (JSF) and a Filter
.
Both of them try to wrap the response, if it isn't already wrapped. So if both the orchestra Filter
and the interceptor are used, the Filter
comes firest, wraps the response object, and sets an attribute in the request, which indicates to the interceptor, that it shouldn't wrap the response again.
The Filter
can be configured to match a certain URL pattern if conversationContext
is to be added. However, for my needs, that pattern matcher was too simple, so I made my own filter instead. So in order to tell the interceptor NOT to wrap the response, all that has to be done is this:
httpRequest.setAttribute(
RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED,
Boolean.TRUE);
Upvotes: 1