In a web application, you cannot access the local file de. You can move the file to be referenced to the project and obtain it through the relative path. Sometimes we need to access the local file, so we can pass in the form of a stream. For example:
In showpic. jsp: <body>
/viewlistener/viewwarecamera/piccreate. jsp? Ppath = <Bean: write name = 'cameraoperateform' property = 'picture _ postion '/> "width =" 500 "Height =" 400 "id =" imgg "/>
</Body>
Here, SRC is implemented by calling another JSP. You can also pass the value to another JSP as needed.
In piccreate. jsp:
<% @ Page import = "Java. Io. *" %>
<%
String ppath = request. getparameter ("ppath ");
String file = "D:/" + ppath;
Fileinputstream in = new fileinputstream (new file (File ));
Outputstream o = response. getoutputstream ();
Int L = 0;
Byte [] buffer = new byte [4096];
While (L = in. Read (buffer ))! =-1 ){
O. Write (buffer, 0, L );
}
O. Flush ();
In. Close ();
O. Close ();
%>
In this way, you can display local files or images.