Good day!
I have a
JSP page which has an input field with "browse" which when clicked by the user he will choose a file. After that my program will get all the files inside the same directory where the first file (which was previously chosen)is located.
As mentioned earlier I have a JSP page, what I did was I constructed a class which will traverse all the file in that directory. In the class I declared
thinking that from the JSP page, I am expecting to receive a File. However, after traversing through the files I need to populate the filenames or file paths in a table in the same JSP page. So what I did was I declared
in the Action Class. My plan is to convert a File[] or File array into a List so that after which I will populate it and send it back to the JSP page. My class that suppose to traverse through the files puts the files in a File array.
My problem is that in my traverse class, which has a "main" method, I am receiving a File to be able to get the other contents of the same directory but in my Action Class, I am expecting a File array to be returned by the traverse class. So that I can convert it to a List and then populate it. But I can't do it because my traverse class doesn't return a File array.
Do I need to remove the "main" declaration and change it to a method? Or should I do something else? Hopefully, someone can give me an advice.
Thanks.