1

I'm using JSF 2.2 with the Mojarra 2.2.10 release along with Glassfish 4.0.

I would like to convert empty submitted string as null so I tried to use:

<context-param>
    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
    <param-value>true</param-value>
</context-param>

But it doesn't work as reported by other users here and here

So the workaround is to define a custom EL resolver (top answer from the first link) which is declared in faces-config.xml.

However, the creates another major issue to me: in my .xhtml pages, a call to #{request.contextPath} is now converted to null when #{request.contextPath} returns an empty string

example.xhtml:

<a href="#{request.contextPath}/book/1">My link</a>

becomes

 <a href="null/book/1">My link</a>
Community
  • 1
  • 1
Mathieu Castets
  • 5,861
  • 3
  • 28
  • 37

0 Answers0