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

(-)test/org/apache/taglibs/standard/tag/ImportTagTest/core/Test37466.java (+53 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.ImportTagTest.core;
18
19
import java.net.*;
20
import javax.servlet.jsp.*;
21
import javax.servlet.http.*;
22
import org.apache.cactus.*;
23
import org.apache.taglibs.standard.testutil.TestUtil;
24
25
public class Test37466 extends JspTestCase {
26
27
    public Test37466(String name) {
28
	super(name);
29
    }
30
31
    protected void setUp() throws Exception {
32
	super.setUp();
33
    }
34
35
    protected void tearDown() throws Exception {
36
	super.tearDown();
37
    }
38
39
    public void test37466() throws Exception {
40
	String serverName = pageContext.getRequest().getServerName();
41
	Integer serverPort = pageContext.getRequest().getServerPort();
42
	String contextPath = ( (HttpServletRequest) pageContext.getRequest() ).getContextPath();
43
	String jspPath = TestUtil.getTestJsp(this);
44
	String testPath = "http://" + serverName + ":" + serverPort + contextPath + jspPath;;
45
46
	URL url = new URL(testPath);
47
	HttpURLConnection connection = (HttpURLConnection) url.openConnection();
48
	connection.setRequestMethod("HEAD");
49
	
50
	String responseCode = Integer.toString(connection.getResponseCode());
51
	assertEquals(testPath + "The response code should be 200", "200", responseCode);
52
    }
53
}
(-)test/web/org/apache/taglibs/standard/tag/ImportTagTest/core/Test37466.jsp (+23 lines)
Line 0 Link Here
1
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
2
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
3
4
<c:import url="/org/apache/taglibs/standard/tag/ImportTagTest/core/Test37466.xml" varReader="xmlSource">
5
<%
6
	java.io.StringReader o = (java.io.StringReader)pageContext.getAttribute("xmlSource");
7
	System.out.println("o: " + o);
8
	char[] buf = new char[1];
9
	while (o.read(buf) > 0)
10
	{
11
		System.out.print(buf);
12
	}
13
	System.out.println("");
14
	System.out.println("------");
15
	o.reset();
16
%>
17
	<x:parse xml="${xmlSource}" var="xmldoc" />
18
</c:import>
19
<%
20
	System.out.println("XX parsed ok");
21
%>
22
23
worked: ${xmldoc}
(-)test/web/org/apache/taglibs/standard/tag/ImportTagTest/core/Test37466.xml (+3 lines)
Line 0 Link Here
1
<foo>
2
	data data data
3
</foo>

Return to bug 37466