How to use facelets' ui:param in 8M1?

已回答

I have a JSF-managed session bean named selectContactSession. In my jsf page, I wrote

<ui:param name="model" value="#{selectContactSession.model}" />

Then IDEA cannot resolve the variable 'model'.

If I write

<c:set var="model" value="#{selectContactSession.model}" />

then IDEA understands what 'model' is.

I never use c:set in JSF so I'm not sure if I can replace all ui:param with it.

5

We have the same problem. Parameter cannot be resolved by IDEA in child pages.

3

Same problem here, parameter cannot be resolved in the same page.

0

Bug still exists after 12 years... It is really annoying, isn't there a fix available somehow? Or a way to tell JSF that the parameter is expected or something without usind the c:set tag? I don't want to directly insert JSP tags into my application

0

There is no workaround, unfortunately. 

Here is the bug request for that: https://youtrack.jetbrains.com/issue/IDEA-63450

You can vote for it to be notified once there are updates. Your comments inside are also welcome. 

0

Actually, I found a workaround:

You can change your facelet from something like this:

<h:body>
<ui:composition>
<h:outputText value="#{parameterName}"/>
</ui:composition>
</h:body>

to something like this:

<h:body>
<!--@elvariable id="parameterName" type="java.lang.String"-->
<ui:composition>
<h:outputText value="#{parameterName}"/>
</ui:composition>
</h:body>

So, you basically just have to add this macro/comment/whatever and change the id and type accordingly, but this shouldn't be the only way

1

请先登录再写评论。