<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ import="java.net.*,java.io.*"%>
<html>
<head>
<title>发送doput事件</title>
</head>
<h3>发送doput事件</h3>
<body>
<%
try{
URL doputServlet=new URL("http://localhost:8080/myJSP/doputdemo");
HttpURLConnection doputServletConn=(HttpURLConnection)doputServlet.openConnection();
doputServletConn.setRequestMethod("PUT");
doputServletConn.setDoOutput(true);
doputServletConn.getInputStream();
FileInputStream inputStream=new FileInputStream(new File("E:/my picture/meilidexin.jpg"));
FileOutputStream outputStream=doputServletConn.getOutputStream();
int b;
if(b==outputStream.read()!=-1){
outputStream.write(b);
}else{
out.println("No such a file was found!");
}
inputStream.close();
outputStrea.close();
}catch(Exception e){
e.printStackTrace();
}
%>
</body>
</html>
为什么客户端报错:
org.apache.jasper.JasperException: /doputTest.jsp(3,4) Invalid directive我该了好几次还不对,请高手指点