I am in the process of trying to untangle the (of course uncommented) code of a contractor that preceded (and I don't have access to currently) me at my current gig and I came across three pieces of code that I found odd and was hoping someone might clue me into why this might have been done, since I can't come up with any valid reason for this I was hoping someone else might clue me in:).
The application is structured as a Java web app, and there are a bunch of JSPs and a handful of servlets. Pretty standard stuff... until I came across four classes that are key to what this application is supposed to do. These classes do not extend HTTPServlet
, but contain a main()
method instead. To make things more confusing, the classes are not referenced anywhere in the project. It's as if they were just dumped in the containing package to avoid creating a new project?
My question in succinct form is this: is there a valid reason to have classes which contain main()
methods contained in a web app?