ImportAttributeTag throws a NullPointerException when ignore=true and the 
attribute value is not available
----------------------------------------------------------------------------------------------------------

                 Key: STR-2996
                 URL: https://issues.apache.org/struts/browse/STR-2996
             Project: Struts 1
          Issue Type: Bug
          Components: Tiles
    Affects Versions: 1.3.5
         Environment: All
            Reporter: Josh Landin


This bug is from regression caused by the fix for STR-2809.

Given the JSP with:

<tiles:importAttribute name="doesntExist" ignore="true"/>

The following exception occurs:

java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:393)
        at 
org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:238)
        at 
org.apache.struts.tiles.taglib.ImportAttributeTag.doStartTag(ImportAttributeTag.java:167)

This is due to the ImportAttributeTag class incorrectly calling 
pageContext.setAttribute with a null value. This call was previously 
unreachable prior to the fix for STR-2809 which eliminated the SKIP_BODY 
returns when ignore=true.

The behavior of the PageContext implementation is consistent with the Servlet 
2.2 Specification:

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/PageContext.html#setAttribute(java.lang.String,%20java.lang.Object,%20int)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to