Spring portlet locale configuration

If you encounter the problem with spring portlet locale configuration, please check the TAG sequence in portlet.xml

  1. cvc-complex-type.2.4.a: Invalid content was found starting with element ‘supported-locale’

This is the sample stack trace i get it from the log file, i had encounter this problem previously. The root cause should be the sequence. For instance, the <supported-locale>en</supported-locale> must put before <resource-bundle>messages</resource-bundle>.

  1.  
  2. Caused by: org.dom4j.DocumentException: Error on line 19 of document  :
  3. cvc-complex-type.2.4.a: Invalid content was found starting with element ‘supported-locale’. One of ‘{"http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":portlet-preferences, "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd":security-role-ref,
  4. ……
  5.  

I summaries the the sequence from top-down as references :

  1. description
  2. portlet-name
  3. display-name
  4. portlet-class
  5. init-param
  6. expiration-cache
  7. cache-scope
  8. supports
  9. supported-locale
  10. resource-bundle
  11. portlet-info
  12. portlet-preferences
  13. security-role-ref
  14. supported-processing-event
  15. supported-publishing-event
  16. supported-public-render-parameter
  17. container-runtime-option
You can leave a response, or trackback from your own site.

2 Responses to “Spring portlet locale configuration”

  1. fenderbirds says:

    nice article, keep the posts coming

  2. Marco says:

    Thanks a lot, exactly what I needed.

Leave a Reply

Security Code: