-1

I enetered this code

<h:outputScript name="jsf.js" library="javax.faces" target="head"/>

But my IDE says that <h:outputScript> tag is not defined in library h which I declared as below.

<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

What's going on?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Billior
  • 23
  • 6

2 Answers2

1

The JSF 2.0 <h:head>, <h:body>, <h:outputScript>, <h:outputStylesheet>, <f:ajax> and all <ui:xxx> tags are not available when you use the ancient JSP as view technology. You should instead be using its successor Facelets, which is usually a XHTML file.

JSP has been deprecated as JSF view technology since 2009 already. Make sure you're reading up to date resources when learning JSF. Start at our JSF wiki page.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

Make sure that your xml name space definitions are correct. To include JSF tag libs you normally need the following:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

   <!-- header and body of your page -->

</html>
Matt Handy
  • 29,855
  • 2
  • 89
  • 112
  • I think its correct <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> – Billior May 04 '12 at 06:57
  • I found the solution. Thanks for your help.The solution was that when i created the new jsf page i had to select in the opti0ns tab the Facelets option. – Billior May 04 '12 at 07:08