we can write some unchanged function and method in init().for example.get the file list.
we can construct a string to save all html conent rather than use pw.print() one by one
we can use a explict method to output the user interface
such as :
private void createUserInterface(HttpServletResponse r){
....
}