I'm developing a web application using JSP/Servlet/JSTL in Eclipse Juno and GlassFish 3.1.2.1. What I need to achieve is to find a way to set the empty strings as null, E.g. Receive a parameter from another page that is set to an empty string and detect it as null. I have been searching and I found a parameter in JSF that I put in the web.xml .
<context-param>
<param-name>
javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
</param-name>
<param-value>true</param-value>
</context-param>
But It didn't work. So what am I missing in those lines? How can I set the empty strings as null?.
As an extra note I need to set this because the system will be working in a Websphere where the empty strings are treated as null.
Thanks in advance.
UPDATE
Another example could be like this:
OnePage.jsp
<form action="anotherPage.jsp">
<input type="text" name="foo" id="idFoo" value="" />
</form>
anotherPage.jsp
<c:out value="${param.foo}"/>
In GlassFish 3.1.2.1 the c:out tag would print nothing as the value is set to empty string. In Websphere Application Server, the value would be null. I need that GlassFish display null values instead of empty strings, as Websphere does.