질문하나만 드릴께요...ㅠ JSP
알
클라에서 JspWriter (out) 을 서버에 넘겨서 out.print 이렇게 출력을 하면 클라에 뜨게 할려고 했는데
안되더라구요..
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.jasper.runtime.JspWriterImpl
에러코드는 이렇게 뜨는데..ㅠㅠ
왜안되는지 설명좀 부탁드릴꼐요^^그리고 해결방안이 있으면 쫌 알려주세요 ㅠㅠ
서버소스
import java.net.*;
import java.util.*;
import java.io.*;
import javax.servlet.jsp.JspWriter;
public class Server implements Serializable{
public static void main(String[] ar) {
ObjectInputStream ois=null;
try {
ServerSocket server = new ServerSocket(10002);
while (true) {
Socket sock = server.accept();
System.out.println(패킷 들어옴);
ois=new ObjectInputStream(sock.getInputStream());
JspWriter jw=(JspWriter)ois.readObject();
jw.print(테스트1);
}
} catch (IOException ee) {
System.out.println(IO +ee);
}catch(ClassNotFoundException ee){
System.out.println(CN +ee);
}
}
}JSP 파일
%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=UTF-8%
%@ page import=chatting.Client %
%Client cl=new Client();
cl.Send(out);
%
Client 소스
package chatting;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Serializable;
import java.net.Socket;
import javax.servlet.jsp.JspWriter;
public class Client implements Serializable{
Socket sock=null;
PrintWriter pw=null;
public void Send(JspWriter out){
try{
sock=new Socket(121.181.110.60,10002);
out.print(Client Out);
ObjectOutputStream os=new ObjectOutputStream(sock.getOutputStream());
os.writeObject(out);
os.flush();
}catch(IOException ee){}
}
}