https://issues.apache.org/bugzilla/show_bug.cgi?id=46249
Summary: "stream closed" problem
Product: Tomcat 5
Version: 5.5.27
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Jasper
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
Tag handler Class:
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.*;
public class sayHello extends BodyTagSupport{
private String name = null;
private String value = null;
private JspWriter out = null;
public void setName(String name){
this.name = name;
}
public int doStartTag(){
try {
getOut();
// out.close();
value += "v";
out.println("hello:" + getName());
out.println("dddd:" + getValue());
} catch (IOException e) {
e.printStackTrace();
}
return 0;
}
public int doEndTag(){
try{
getOut();
out.print("<br>");
}catch(IOException e){
e.printStackTrace();
return 1;
}
return 0;
}
public JspWriter getOut() {
if (out == null) {
System.out.println("get out..................");
out = pageContext.getOut();
}
return out;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getName() {
return name;
}
}
a jsp:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/mytld.tld" prefix="aa" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
</head>
<body>
<aa:sayHello name="aaaaaaaaaaaaaaa"
value="/web/bsloginAction.do?method=setArea&id="></aa:sayHello>
</body>
</html>
access this jsp page ,might be thrown "Stream closed" Excepetion.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]