How to include a file depending on a request attribute using the include directive-Collection of common programming errors

Not with as that is a static/compile time include. You could instead use tag, which is evaluated at runtime, and includes the result of executing that page, rather than including the page itself at compile time.

To compare all the differences between the include directive and check out JSP2.0 Reference


The tag would also work if you are using JSTL.