① in the Viewallplat project to create Class Filetool under Package Com.baosight.viewall.common, inherit applets, add the following method to the class:
/** * @authorDongmingwang * @time 20150807 *@returnFilePath*/ PublicString Selectfilepath () {Try{Uimanager.setlookandfeel (Uimanager.getsystemlookandfeelclassname ()); JFileChooser JFC=NewJFileChooser (); Jfc.setfileselectionmode (jfilechooser.directories_only); Jfc.showdialog (NULL, "select"); File File=Jfc.getselectedfile (); if(File! =NULL) returnFile.getabsolutepath (); }Catch(Exception e) {e.printstacktrace (); } return"C:\\hisvideo"; }
Selectfilepath
② package This class into a Filetool.jar file placed under the applet path under Project WebContent
③ Add the following code to reference the applet in page zjsp02.jsp:
<id= "Filepathchoose"= "Com.baosight.viewall.common.FileTool" codebase= "applet/" archive= "Filetool.jar" width= " 0 " height=" 0 "></applet>
Filepathchoose
④ Add the following method to the file Zjsp02.js to call the above Java method
/** * @author Dongmingwang * @time 20150804 * File path selection */function Selectfilepath () { var filePath = Filepat Hchoose.selectfilepath (); $ (Id_txtpath). Val (FilePath);}
Selectfilepath
NOTICE: This method requires the client to have a JRE environment, and when it comes to security issues, it is necessary to sign authentication when playing the jar package of the applet.
xinbei-Monitoring management-historical video retrieval = Add image download Path function