• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can the new Facelet Tag Libraries URI's be used in older JSF versions?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In JSF 2.2 the Facelet Tag Libraries URI's changed from: to: so that means the new namespaces applies only for JSF 2.2 or they can or should be used in older versions like 2.0, 2.1 or 1.x?

Thanks.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're saying what I think you're saying, the URIs are used to identify XML schemas. XML schemas are used by the XML digesting code to validate XML. They do not control what version of the tag library will be used, just what syntax-checking rules will be applied when digesting the View Template.

Or in other words, if you use the wrong schema, the digester may reject a View Template that uses features that are supported by the tag library but not by the schema. Or, conversely, allow you to create View templates that are parsed as valid, but not properly processable by the tag library.
 
Alex Orozco
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

I'm not sure if we are on the same page (sorry, I'm new to JSF ), on the specification says that the old tag libs, for example:

were replaced by:

But it does not clarify if the new taglibs are used only for the new JSF 2.2 version or for all versions, for example, I'm not sure if this code is valid for an old JSF version i.e. JSF 2.0


Thanks
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried typing "http://xmlns.jcp.org/jsf/core" into your web browser?

The URIs do not control what tag libraries are used. They control what XML schemas are used to validate the XML that they are referenced from. That's ALL they're used for. They don't locate any software components, they only guide the compilation process of the View Template in a simple binary fashion - "pass" or "fail". If the View Template (.xhtml) file contains elements or attributes not defined by one of the schemas provided, the entire XML will be rejected. Likewise, the XML will be rejected if you don't provide all the elements and/or attributes a schema demands. You can see this in action by ripping out one of the namespace references such as "http://xmlns.jcp.org/jsf/html". The page will no longer be processable even though the actual tag libraries are still present.

If you reference a schema that doesn't accurately represent the tag libraries, then things may go wrong at runtime, because the XML will have been digested into a DOM that doesn't match what the tag libraries expect.

I'm not sure about the switch from the sun domain to the jcp domain. Ordinarily, I'd say that jcp would be only applicable to pre-release implementations, but Oracle may be getting less involved in the standard and thus backing away from the sun domain name. What matters isn't the namespace name, however, it's how well that particular schema maps to the JSF tag libraries that you are actually using. If you code JSF2.2 schemas into an app and only use JSF2.0 features, you'd have no problems if your webapp server is based on JSF2.0 tag libraries. But if you code JSF2.2 XML into your View Templates, that won't magically upgrade the underlying tag libraries. They'll remain at 2.0.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic