Directory listing Web App

2. SSP to generate links to the file
Files Servlet To provide continuity of browsing, sort order, path to 'one level up folder' are stored in the session


If SortBy is not specified in the request take it from session, if order is already in session retain it. If SortBy specified in the request is same as that of the one in the session then toggle the order. Order can take a value of -1 or 1 for descending and assenting.

In the same way update the root variable based on request and session values.

Program scans for files/folders at the path specified by root relative to the system base path. Update the attributes and dispatch the request.

Specify the value for sysBasePath in web.xml. Program scans for the files and folder from this path. Giving a value of “C:\\” makes it to scan the complete C Drive.