Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable jftfdi jffi query params in JSF

I tried the last version of JavaServer Faces 2.2 (Mojarra 2.2.4) and noticed changing my query string in this unwanted way:

page.jsf?jftfdi=&jffi=

instead of

page.jsf

I've found that it is the new JSF 2.2 feature. But these query params(jftfdi, jffi) spoil me SEO-friendly urls. How can I disable it?

like image 682
gry Avatar asked Oct 08 '13 18:10

gry


1 Answers

This is a bug in Mojarra. They should not have been appended when there's no means of any flow navigation configuration (by the new @FlowScoped annotation and <j:flow-xxx> tags).

Basically, the OutcomeTargetRenderer class who's responsible for HTML output generation of the <h:link> and <h:button> is incorrectly checking if NavigationCase#getToFlowDocumentId() returns non-null before appending the flow navigation parameters. However, based on the javadoc the base implementation never returns null, but an empty string. Therefore, the renderer always thinks that it's in middle of a flow navigation and always appends the associated jftfdi and jffi request parameters. The fix is to let it check as well if it returns a non-empty string.

I reported it as issue 3054 and they confirmed that this is a bug and are currently working on it. The fix will likely be available in Mojarra 2.2.5.

Update: as of now, less than a day later, it's fixed for 2.2.5.


By the way, the jftfdi stands for "javax.faces To Flow Document ID" which is specified as follows in the javadoc:

Components that are rendered by Renderers of component-family javax.faces.OutcomeTarget must use this constant as the parameter name for a parameter representing the defining document id of the flow that this component will cause to be entered.

and the jffi stands for "javax.faces Flow ID" which is specified as follows in the javadoc:

Components that are rendered by Renderers of component-family javax.faces.OutcomeTarget must use this constant as the parameter name for a parameter representing the flow id of the flow that this component will cause to be entered.

like image 162
BalusC Avatar answered Oct 19 '22 23:10

BalusC