Bug 7837 - NPE occurs when a formatting action attempts to obtain locale from parent <fmt:bundle> action.
Summary: NPE occurs when a formatting action attempts to obtain locale from parent <fm...
Status: RESOLVED INVALID
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-08 14:16 UTC by Ryan Lubke
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Lubke 2002-04-08 14:16:57 UTC
Given:

**********************************************************
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import="java.util.Date" %>
<html>
<head><title>test</title></head>
<body>
    <%
        Date date = new Date(883192294202L);
        pageContext.setAttribute("dte", date);
    %>
    <fmt:timeZone value="EST"/>
    <c:set var="dt" value="Nov 21, 2000 3:45:02 AM"/>
    <fmt:bundle basename="some.package.Resources1">
        <fmt:parseDate value="${dt}"/>
        <fmt:formatDate value="${dte}"/>
        <fmt:parseNumber value="1,234"/>
        <fmt:formatNumber value="1234"/>
    </fmt:bundle>
</body>
</html>
**************************************************************************

Additional Information:
 - The provided basename resolves to a single resource bundle:
      some.package.Resources1_en_US

 - The client sens only en-US in the Accept-Language request header.

Result:
java.lang.NullPointerException 
 	at
org.apache.taglibs.standard.tag.common.fmt.LocaleSupport.getFormattingLocale(LocaleSupport.java:265)
        at
org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport.doEndTag(ParseDateSupport.java:157)
Comment 1 Ryan Lubke 2002-04-16 01:09:37 UTC
Bug is now invalid due to PFD changes.  Class structure is different than that
reported by the included stacktrace.