views:

110

answers:

1

Due to a design decision, our project contains JSP files that include other JSP files like so:

<jsp:include page="/jsp/controls/InputControl.jsp"/>

These JSP files exist under the WebContent/jsp folder of the project.

Is it possible to move the JSP files to another package (i.e. com.company.project.components.jsp) and include them from there instead? And if so, how?

A: 

It is in theory possible, but why would you want to do that? This makes no sense. If you actually want to hide them from direct access by URL (which is indeed very reasonable), then just place them in /WEB-INF folder.

In the future, try to ask how to solve a problem, not how to achieve a solution which may not be the right solution after all ;)

BalusC
As I said, this problem is based on a design decision (not made by me). The reason why we would want to do something like this is that we are creating a custom framework that generates the UI dynamically by including jsp files that contain the visual representation of controls. The controls get their values by using properties set via EL. However, although we can put the framework components into own packages, the corresponding jsp files need to be part of the applications' project after all. And I was only wondering if they can be moved to the packages as well.
Mephisztoe
Sorry, I still don't see any reason why they cannot be kept in webcontent. You was "only wondering". Well, it is in theory possible, but you don't want to do that.
BalusC