Display dynamic html pages in browser using jsp/servlet
I want to display html files dynamically (last modified at t开发者_如何学JAVAhe top) using JSP/Servlet. Please help me .
You will have list of file in your DIR. so using
listFiles()
retrieve all files.Take them in Collection.
Implement a Comparator and use
lastModified()
to compare and sort . and take first n files and displayPut this logic in service classes and call them from servlet
精彩评论