What is the XML namespace URI of Spring Message Facelets <s:messageSource> tag?

393 Views Asked by At

According to those tutorials about i18n in SpringFaces:

  1. http://www.javacodegeeks.com/2012/06/spring-jsf-integration.html
  2. https://coderphil.wordpress.com/2011/11/15/integrating-spring-javaserver-faces-internationalization-and-localization/

We should be able to use Spring messageSource bean directly in XHTML Page using <s:messageSource> tag:

<s:messageSource source="#{messageSource}" var="messages"/>
  <p>
     <h:outputText value="#{messages.hello}"/>
  </p>
</s:messageSource>

However, those tutorials does not make any mention of the XML namespace URI which I should specify in xmlns:s="...".

What is the proper XML namespace URI?

2

There are 2 best solutions below

0
kolossus On BEST ANSWER

I nearly resorted to the "Google it" comment, but after a bunch of googling myself, I'm amazed how obscure/scarce this information is. Almost no one giving a "hello world" tutorial even mentions the tag library's namespace. The Spring docs are even more confusing on this. What you're looking for is http://www.springframework.org/tags. I'd leave a comment on those tutorials you linked also, for the authors to include this trivial but fundamental piece of info

0
Aníbal On
xmlns:s="http://springframework.org/tags/springfaces"

as defined in springfaces/src/main/resources/META-INF/springfaces.taglib.xml file of springfaces library (Mind not to confuse it with spring-faces).

Remember to include springfaces as a dependency.

You can figure it out looking for any xhtml file in its showcase, like this for example.