P
PLWang
Unregistered / Unconfirmed
GUEST, unregistred user!
想做一个jsp页面 执行时通过一个socket连接另一台机器上的服务端程序 简单地发送一串
字符作为通知消息 即可
代码如下
MySignal.java
import java.io.*;
import java.net.*;
public class MySignal
{
private Socket soc = null;
private DataOutputStream out = null;
public MySignal()
{
try
{
soc = new Socket("10.10.10.202", 7500);
out = new DataOutputStream(soc.getOutputStream());
out.writeBytes("Signal");
out.close();
soc.close();
}
catch (IOException ioe)
{
System.out.println("IOException:"+ioe);
}
}
}
test.jsp
<%@ page contentType="text/html;
charset=gb2312" %>
<%@ page import="HY.MySignal" %>
<%@ page language="java">
<%
MySignal ss = new MySignal();
%>
<html>
<head>
<title>发送信号</title>
</head>
<body>
test
</body>
</html>
执行时出现错误
The server encountered an internal error (Internal Server Error) that prev
ented it from fulfilling this request
不知道是哪的问题 请教
字符作为通知消息 即可
代码如下
MySignal.java
import java.io.*;
import java.net.*;
public class MySignal
{
private Socket soc = null;
private DataOutputStream out = null;
public MySignal()
{
try
{
soc = new Socket("10.10.10.202", 7500);
out = new DataOutputStream(soc.getOutputStream());
out.writeBytes("Signal");
out.close();
soc.close();
}
catch (IOException ioe)
{
System.out.println("IOException:"+ioe);
}
}
}
test.jsp
<%@ page contentType="text/html;
charset=gb2312" %>
<%@ page import="HY.MySignal" %>
<%@ page language="java">
<%
MySignal ss = new MySignal();
%>
<html>
<head>
<title>发送信号</title>
</head>
<body>
test
</body>
</html>
执行时出现错误
The server encountered an internal error (Internal Server Error) that prev
ented it from fulfilling this request
不知道是哪的问题 请教