reset password
Author Message
kknaur
Posts: 540
Posted 17:35 Oct 10, 2010 |

I am currently stuck on the Folder Display part.  The thing that is stumping me is how best to store the data about the files.  Should we use a custom File class or the java.io.File class.  I assume the java.io.File class is not "bean friendly" so maybe a custom one is the way to go? 

Also, when the user clicks on a folder to display that folder, the way I have it set up is that the folder is a link back to my DisplayFolder.java servlet with a parameter attached with the necessary information to display the new folder.  Is there a better way to send information from a JSP page back to a servlet without appending parameters to the end of the URL or a way to keep those parameters hidden?  I don't want the user to be able to just stick random parameters into the URL.

cysun
Posts: 2935
Posted 17:47 Oct 10, 2010 |
kknaur wrote:

I am currently stuck on the Folder Display part.  The thing that is stumping me is how best to store the data about the files.  Should we use a custom File class or the java.io.File class.  I assume the java.io.File class is not "bean friendly" so maybe a custom one is the way to go? 

You should create your own File class, and it's not just about "bean friendly". The java.io.File class encapsulate the information and operations associated with disk files - it may not be suitable or sufficient for an online file manager application.

kknaur wrote:

Also, when the user clicks on a folder to display that folder, the way I have it set up is that the folder is a link back to my DisplayFolder.java servlet with a parameter attached with the necessary information to display the new folder.  Is there a better way to send information from a JSP page back to a servlet without appending parameters to the end of the URL or a way to keep those parameters hidden?  I don't want the user to be able to just stick random parameters into the URL.

You could create a JavaScript onclick handler so that clicking on a link would submit a form in a POST request, but it's tedious and unnecessary. If a user wants to change parameters, they can always do that. The application should guard against invalid parameters in some other ways.