Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF AJAX integration  RSS feed

 
nek johnson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

While usiing JSF f:ajax tag, I am getting the following error for not being able to load jsf.js file.

Can anyone please give me recommendations on resolving this error?

JSF1064: Unable to find or serve resource, jsf.js.xhtml


Thanks for your help

Nek
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Difficult to say without knowing what you code have in the head section of your page. Also what version of jsf are you using and does everything work if you don't have the f:ajax tag?
 
nek johnson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JSF 2.0

And I donot have anything in the head section of the code
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you provide more information? Where are you deploying the application? Do you have JSF jars in your war/lib or are you using your container's implementation?
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a wild guess: Are you using the h:head tag instead of html <head>? In older versions of JSF this tag didn't exist, but in JSF2 it does and it's essential for a lot of the support functions to get pulled in and to mark the places where JSF renders out-of-line elements.
 
nek johnson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am deploying inside wildly container. Also I am using h: head tag.


Also another error message I get is request type incorrect . It says it's http request where as it expects xhr request .
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best way to see if the files are there or not, open Firefox's firebug or equivalent.

 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My mind blanked yesterday, Actually, you also need h:body, in case you didn't also have that one.

The fact that you're getting an internal JSF error message instead of a "404" error is significant. Normally, you'd get "404 - Resource not found", but the js.jsf.xhtml resource isn't part of your WAR as such, it's generated by JSF when an AJAX component needs it. Details may vary, but you may find its prototypes in the JSF implementation JAR(s), the actual JavaScript is customized for the browser's JS quirks (IE, Firefox, and so forth), and the resource itself is an all-in-one module such that for a given client session it can be cached client-side (doesn't change on a per-request basis).

If you've got the h:head and h:body tags, it's possible that your JSF environment is broken - the web.xml file might be improperly specified, JSF jars could be corrupt, or for full-stack JEE servers like WildFly, you might have included JSF implementation jars in your WAR that conflict with the built-in JSF implementation of the server itself.
 
nek johnson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks

Actually its strange. But I found the issue with the web.xml. It was not taking correct url pattern.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!