1

i want to use the f:viewAction of JSF 2.2, but it is not working.

my faces-config:

<faces-config version="2.2"
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">

xhtml-definition:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://xmlns.jcp.org/jsf/core" 
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <f:metadata>
        <f:viewAction action="#{bean.welcomeUser()}" onPostback="false"  />
    </f:metadata>

...

</html>

the problem is that it underlines the f, h and the ui-namespace (with a warning: NLS missing message: CANNOT_FIND_FACELET_TAGLIB in: org.eclipse.jst.jsf.core.validation.internal.facelet.messages)

what can I do to make it work again? ( i have included myfaces-impl-2.2.0 and the myfaces-api-2.2.0)

EDIT: When i include jsf impl 2.2 and api 2.2 to my project, the warning disappears, but then the compiling gets big problems (factory not found etc)

Niko
  • 1,054
  • 5
  • 25
  • 52
  • Which is your setup (server/framework/whatever)? – SJuan76 Aug 31 '13 at 16:36
  • Are you using Eclipse ? – Konstantin Yovkov Aug 31 '13 at 16:50
  • And why have you posted non-completed `faces-config.xml` ? – Konstantin Yovkov Aug 31 '13 at 16:56
  • yes, i use eclipse and tomcat 7 the faces-config has nothing interesting inside, just imagine it is complete – Niko Aug 31 '13 at 16:56
  • If you're absolutely positive that JSF is properly installed, then those warnings are harmless. It's just another stupidity of Eclipse. What happens if you run the code anyway? See also [this duplicate question](http://stackoverflow.com/questions/7546219/nls-missing-message-cannot-find-facelet-taglib/) whose answer was kindly copypasted and rephrased by kocko. – BalusC Sep 01 '13 at 01:43
  • hi, i already tried the four steps (kocko), but none of them worked. could it be a problem that i previously used jsf 2.0 and then updates the faces-config to 2.2 manually? as already mentioned, i am using myfaces-api and impl. 2.2.0. are these the jsf files or are there others too? – Niko Sep 01 '13 at 11:58
  • Please answer what happens if you run the code anyway? Then we can tell if the problem is in JSF impl or in Eclipse. And NO you should not mix Mojarra with MyFaces. You should use the one OR the other. – BalusC Sep 01 '13 at 21:18
  • Same problem for me! In my case although netbeans shows errors but pages work fine. How should I fix netbeans then ? I use netbeans 7.2! – Rajat Gupta Nov 11 '13 at 06:55
  • Were you able to resolve the errors somehow in NetBeans 7.2.x? @user01 – Tiny Apr 12 '14 at 00:27
  • @Tiny It works for me for JSF2.2 in netbeans 7.2/7.4 but I dont remember exactly how I managed to fix that.. probably have a look at this: http://jsflive.wordpress.com/2013/05/16/jsf22-namespaces/ – Rajat Gupta Apr 12 '14 at 06:49
  • @user01 : I have just upgraded NetBeans to the latest release [8.0](https://netbeans.org/downloads/) in which it works (in the previous version [7.2.1](https://netbeans.org/downloads/7.2.1/), it did not work even with [those](http://jsflive.wordpress.com/2013/05/16/jsf22-namespaces/) configurations. I have already had them). Thank you :) – Tiny Apr 12 '14 at 06:53
  • @Tiny: btw I just read your aboutme on this site & I am very glad to know about your self learning desire & enthusiasm. You're really 14 ?! Very well done! – Rajat Gupta Apr 12 '14 at 07:08
  • @user01 : Yes I'm 14 (since 29th February 2000). Thank you very much for a positive opinion. ;) Otherwise, some people are likely to react negatively looking at the age. ;) – Tiny Apr 12 '14 at 14:39

1 Answers1

0

Your described behaviour still persists in MyFaces 2.2.8, the problem with f:viewAction is well known. It should be fixed in Eclipse 3.7.2 (Mars.2) and MyFaces 2.2.9.

You have no Eclipse autocompletion for the tag, but you can actually use it as expected.

Reference:

DanielK
  • 424
  • 6
  • 17