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

  • Use the right tool for the right job!!!!!
    – AllTooSir
    May 13, 2013 at 16:05
  • what does that mean? do not use a jsp to control flow? even though can edit it without full redeploy? it does everything a real servlet controller does
    – tgkprog
    May 13, 2013 at 19:45
  • 1
    It was meant to be the view part of the MVC and not the controller, that's what I said.
    – AllTooSir
    May 14, 2013 at 4:26
  • okay thank you. for this build its going to be as is, have to see about some re-loadable logic as sometimes we need to make minor changes
    – tgkprog
    May 14, 2013 at 12:33

1 Answer 1


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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.