Wednesday, March 08, 2006

javax.servlet.ServletException: Define tag cannot set a null value

If you are using struts and get this error, it means you might have used
tag for a value which is null.

The problem would be solved if you use tag to check for the null value.
e.g.

1 <logic:notEmpty name="fooForm" property="fooList">
2 <bean:define id="fooList" name="fooForm" property="fooList" />
3 <html:options collection="fooList" property="id" labelProperty="fooname" />
4 </logic:notEmpty>

The 'fooList' is checked before being defined in the samplecode

No comments: