0
Tomcat 7에서 JSP로 웹 응용 프로그램을 작성하고 있습니다. Tomcat 서버에서 공유 폴더 드라이브로 저장된 로그 파일을 검색 할 수 있어야합니다. 컴퓨터로 변환 한 다음 정규 표현식으로 구문 분석 할 수 있습니다. 그러나 양식을 사용하여 파일을 수동으로 업로드하지 않고도 파일을 검색 할 수 있습니까? 대신 다른 네트워크 드라이브의 드라이브 (로컬 컴퓨터) : Apache 상자의 Tomcat Server에서 파일 가져 오기
나는이public void init() throws ServletException {
// Define base path somehow. You can define it as init-param of the servlet.
this.filePath = "/Users/oakesjo/Documents/LogViewerTools";
// In a Windows environment with the Application server running on the
// c: volume, the above path is exactly the same as "c:\files".
// In UNIX, it is just straightforward "/files".
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, IOException {
// Get requested file by path info.
String requestedFile = request.getPathInfo();
...}
는 그러나, this.filePath
단지 내 C에 나에게 파일에 액세스하게됩니다 시도했다. 이것을 구성하는 다른 방법이 있습니까? 또한 : 문자열에 파일을 자동으로 저장하는 옵션이 있습니까?