Most people say do not use JSPs. But what if I have a JSP that does not show anything, it only acts as a controller? Why would I do that? Because we do not need to redeploy complete webapp to make a small but significant change in a servlet -> instead can just put my new JSP in the JBoss tmp folder till we do a full deploy.
This controller JSP will of course include / redirect to other view JSPs for final rendering.
Question what are the downsides of doing this? If we already have it in our application (it’s been working for the last 8 years before I joined); should we keep it as it works or are there any compelling reasons to change it to a regular servlet?
Note: the JSPs in question are not the only controller, rather they do some of the processing for certain use cases
4
Having a jsp as a controller is wrong for multiple reasons. Development mode should not dictate application architecture or in other words if you need hot deploy choose a proper tool/server for that. Adding an intermediate controller (jsp) create many data handling problems than it solves. For instance how do you handle passing request parameters? How do you handling error validation? Can you keep the user to initial page if there were validation errors? This are just a couple of issues that comes immediately.
Now, for your real problem, actually you don’t need the controller jsp. You said you use jboss, on jboss you can deploy an application exploded. In that case if you overwrite a jsp with a new version (copy from development directory) and refresh the view the page is displayed based on the last version. You can have hot reload also for java classes but for that you need a special tool. Take a look on this question Which Java web frameworks provide hot-reload?