Bug 7257 - c:set should support null values
Summary: c:set should support null values
Status: CLOSED DUPLICATE of bug 7223
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0B1
Hardware: PC All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-19 23:13 UTC by Serge Knystautas
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Knystautas 2002-03-19 23:13:51 UTC
We did a query using <sql:query>, and was using the <c:forEach> tag to iterate
through the rows.  Then we called <c:set var="ccid" scope="page"
value="${row.creditcard_id}" />.  According to 4.3, c:set should support null
values, but we got the following exception:
org.apache.taglibs.standard.tag.common.core.NullAttributeException: The
"value" attribute illegally evaluated to "null" or "" in <set>.
Comment 1 Shawn Bayern 2002-03-19 23:34:16 UTC
This works for me in the final Beta 1 release.  Serge - are you sure you're 
working against the actual Beta 1 release?
Comment 2 Serge Knystautas 2002-03-20 03:17:22 UTC
Yes, I just downloaded JSTL beta 1 again to be sure.  (as well as Tomcat 4.0.3
to test in case it was a Resin servlet engine problem).  I get the same problem.
 Recreatable by doing these steps:

1. Create a JSP and put this in there:
<%@ taglib uri="http://java.sun.com/jstl/ea/core" prefix="c" %>
<c:set var="testing" scope="page" value="${nonexistantattribute}" />

2. Call that JSP in Tomcat 4.0.3.  You get this stack trace:
org.apache.taglibs.standard.tag.common.core.NullAttributeException: The "value"
attribute illegally evaluated to "null" or "" in <set>
at org.apache.taglibs.standard.tag.el.core.SetTag.doEndTag(SetTag.java:130)
	at org.apache.jsp.index$jsp._jspService(index$jsp.java:83)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
etc..

3. Or call that JSP in Resin.  You will get this stack trace:

org.apache.taglibs.standard.tag.common.core.NullAttributeException: The
"value" attribute illegally evaluated to "null" or "" in &lt;set&gt;
	at org.apache.taglibs.standard.tag.el.core.SetTag.doEndTag(SetTag.java:130)
	at _index__jsp._jspService(/index.jsp:12)
	at com.caucho.jsp.JavaPage.service(JavaPage.java:74)
	at com.caucho.jsp.Page.subservice(Page.java:485)
etc...
Comment 3 Shawn Bayern 2002-03-20 03:35:29 UTC
Ah.  Instead of your version being too old, mine was too new.  :-)
This was fixed AFTER Beta1.  It's actually a duplicate of bug #7223.

*** This bug has been marked as a duplicate of 7223 ***