PrimeFaces is not defined error

UI Components for JSF
Post Reply
giladno
Posts: 20
Joined: 29 Dec 2009, 16:39

03 Mar 2010, 18:14

Hello all,

I'm using tomcat6, primefaces-1.0.0.jar.

I have a page with a datatable, filled by lazyModel:

Code: Select all

<p:dataTable id="entries" widgetVar="mydatatable" var="item" value="#{bean.lazyModel}" paginator="true" rows="10" lazy="true" dynamic="true" emptyMessage="No entries found">
	<p:column>
		<h:outputText value="#{item.value}" title="#{item.longValue}" escape="false"/>
	</p:column>
</p:dataTable>
When page loaded, the following reported by firebug:

Code: Select all

PrimeFaces is not defined error
<script type="text/javascript">PrimeFa...nContentReady('entries', function() {
From web.xml:

Code: Select all

<servlet>
		<servlet-name>Resource Servlet</servlet-name>
		<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>Resource Servlet</servlet-name>
		<url-pattern>/primefaces_resources/*</url-pattern>
	</servlet-mapping>
The page contains p:commandButton, and its rendered properly.

Is there something I did wrong?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 Mar 2010, 18:18

url-pattern should be singular;

Code: Select all

  <servlet-mapping>
      <servlet-name>Resource Servlet</servlet-name>
      <url-pattern>/primefaces_resource/*</url-pattern>
   </servlet-mapping>

perissf
Posts: 15
Joined: 13 Nov 2010, 12:50

13 Nov 2010, 13:01

Sorry I am facing the same issue. Url is singular. Using PrimeFaces2.2 and Glassfish 3.0.1. My web page including primefaces components is always displayed entirely, and the error is always present, even if I remove or change the resource servlet mappings!

Here the error details:

Agente utente: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Sat, 13 Nov 2010 10:56:49 UTC


Messaggio: 'PrimeFaces' non è definito
Linea: 1
Carattere: 130327
Codice: 0
URI: http://localhost:8080/WarehouseTest1/fa ... primefaces

perissf
Posts: 15
Joined: 13 Nov 2010, 12:50

13 Nov 2010, 13:33

Solved!
It seems that this line was necessary in my case:

<load-on-startup>1</load-on-startup>

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Nov 2010, 14:38

You don't need to add Resource Servlet with PrimeFaces 2.2+, PrimeFaces is zero-config.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 42 guests