I m writing a web app where there is a file selection done. And in there is a java class where this path has to be printed out. In simple terms I want the file full path selected in JSP to be printed in a Java Class.
In regular java classes, we import the class1 into class2 and get the path.
But I m unable to know how can I do this using a jsp and a java class.
In jsp, I m using
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script type="text/javascript"> function setExcelPath() { } </script> </head> <body> <input type="file" name="fileName" id="fileName" /> <input type="submit" value="Set" onclick="setExcelPath()" /> </body> </html>
Here I m able to see the textbox with the file path along with path. Please let me know how can i send this value to a java class.
I need this path since there is some other Apache POI code to be written based on this selection.
Thanks