View | Details | Raw Unified | Return to bug 35216
Collapse All | Expand All

(-)test/org/apache/taglibs/standard/tag/el/xml/Test35216.java (+43 lines)
Line 0 Link Here
1
/*
2
 * Copyright 1999,2004 The Apache Software Foundation.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
17
package org.apache.taglibs.standard.tag.el.xml;
18
19
import javax.servlet.jsp.*;
20
import org.apache.cactus.*;
21
import org.apache.taglibs.standard.testutil.TestUtil;
22
23
public class Test35216 extends JspTestCase {
24
25
    public Test35216(String name) {
26
        super(name);
27
    }
28
29
    protected void setUp() throws Exception {
30
        super.setUp();
31
    }
32
33
    protected void tearDown() throws Exception {
34
        super.tearDown();
35
    }
36
37
    public void test35216() throws Exception {
38
        String toInclude = TestUtil.getTestJsp(this);
39
        pageContext.include(toInclude);
40
41
        // fail case throws an exception; so nothing further needed
42
    }
43
}
(-)test/web/org/apache/taglibs/standard/tag/el/xml/Test35216.jsp (+8 lines)
Line 0 Link Here
1
<%@ page session="false" %>
2
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
3
4
<x:parse xml="<content/>" var="doc" scope="request" />
5
6
<x:forEach select="$doc//*">
7
    foo
8
</x:forEach>
(-)src/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java (-10 / +17 lines)
Lines 97-113 Link Here
97
            variableVector.addElement( new QName(null, varName ) );
97
            variableVector.addElement( new QName(null, varName ) );
98
            globalVarSize++;
98
            globalVarSize++;
99
        }
99
        }
100
        enum_ = pageContext.getAttributeNamesInScope( 
100
101
            PageContext.SESSION_SCOPE );
101
        if (pageContext.getSession() != null) {
102
        while ( enum_.hasMoreElements() ) {
102
            // we may have a page directive preventing session creation/access
103
            String varName = (String)enum_.nextElement();
103
            // do not attempt to retrieve attribute names in session scope
104
            QName varQName = new QName ( SESSION_NS_URL, SESSION_P,varName); 
104
            // @see [ http://issues.apache.org/bugzilla/show_bug.cgi?id=35216 ]
105
            //Adding both namespace qualified QName and just localName
105
            enum_ = pageContext.getAttributeNamesInScope( 
106
            variableVector.addElement( varQName );
106
                PageContext.SESSION_SCOPE );
107
            globalVarSize++;
107
            while ( enum_.hasMoreElements() ) {
108
            variableVector.addElement( new QName(null, varName ) );
108
                String varName = (String)enum_.nextElement();
109
            globalVarSize++;
109
                QName varQName = new QName ( SESSION_NS_URL, SESSION_P,varName); 
110
                //Adding both namespace qualified QName and just localName
111
                variableVector.addElement( varQName );
112
                globalVarSize++;
113
                variableVector.addElement( new QName(null, varName ) );
114
                globalVarSize++;
115
            }
110
        }
116
        }
117
111
        enum_ = pageContext.getAttributeNamesInScope( 
118
        enum_ = pageContext.getAttributeNamesInScope( 
112
            PageContext.APPLICATION_SCOPE );
119
            PageContext.APPLICATION_SCOPE );
113
        while ( enum_.hasMoreElements() ) {
120
        while ( enum_.hasMoreElements() ) {

Return to bug 35216