在jsp程序中导入apache.commons.net文件时出错

时间:2016-07-20 07:02:22

标签: jsp telnet apache-commons-httpclient apache-commons-net

我在运行jsp程序时遇到错误 我正在使用Apache Tomcat服务器并手动将我放入webapp下的项目中,我下载了apache.common.net jar文件,我已经将这些jar文件添加到我的类路径中,但这些都没有导入。

An error occurred at line: 15 in the jsp file: /QISDB.jsp
TelnetClient cannot be resolved to a type
12: 
13: <%@ page import="java.io.*"%>
14: <% 
15: TelnetClient telnet = new TelnetClient();
16: 
17: try {
18:   telnet.connect("google.com", 80);

这是我的Jsp程序

<html>
<head><title>QISTest</title></head>
<body>
<table>
<%@ page import="org.apache.commons.net.telnet.*" %>
<%@ page import="org.apache.commons.net.telnet.TelnetNotificationHandler"%>
<%@ page import="org.apache.commons.net.telnet.SimpleOptionHandler" %>
<%@ page import="org.apache.commons.net.telnet.EchoOptionHandler" %>
<%@ page import="org.apache.commons.net.telnet.TerminalTypeOptionHandler" %>
<%@ page import="org.apache.commons.net.telnet.SuppressGAOptionHandler" %>
<%@ page import="org.apache.commons.net.telnet.InvalidTelnetOptionException" %>

<%@ page import="java.io.*"%>
<% 
TelnetClient telnet = new TelnetClient();

try {
  telnet.connect("google.com", 80);
  System.out.println("connection succesful");
} catch(IOException e) {
  System.err.println("Exception while reading socket:" + e.getMessage());
} finally {
  telnet.disconnect();
}
%>
</body>
</html>

0 个答案:

没有答案