This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Forcing JSF to ignore a namespace when parsing xhtml  RSS feed

Michael Daniels
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I tried searching all over google for the answer to this and can't figure out if I'm wording my searches wrong or what. I need to force JSF to ignore a namespace when parsing xhtml.

I am working on an application developed using JBOSS SEAM which uses JSF. In one of the .xhtml files I have code similar to:

I need to do this for a javascript library I am using to insert tooltips into the application. If I run the application as shown above, I get an exception saying
Error Parsing /page.xhtml: Error Traced[line: 43] The prefix "abc" for attribute "abc:def" associated with an element type "input" is not bound.

I tried adding a namespace declaration to the ui:composition tag:

However, when I do this, the new attribute is not output in the markup produced by the application. I'm hoping there is something simple I'm missing here. Any help would be greatly appreciated.

Mike Daniels
[ January 06, 2008: Message edited by: Michael Daniels ]
Tim Holloway
Posts: 18704
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off, putting plain HTML in JSF pages is dangerous. Doubly so for things like form objects, since the raw HTML forms construct objects that don't integrate seamlessly with the JSF forms objects.

Secondly, no JSP tag (and that includes JSF tags) allows you to add attributes as you please. If the attribute isn't defined in the TLD, the JSP compiler will reject it. And from your message, it's evident that the JSP compiler is trying to compile your input tag.

If you want to mark an object as the target for magic, it's better to simply refer to it via its id attribute.

If you absolutely insist on doing it this way, try bracketing the input tag in a JSF <f:verbatim> tag body. But I offer no guarantees as to what the results might be.
[ January 07, 2008: Message edited by: Tim Holloway ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!