Open mthmulders opened 4 years ago
I think the sample application link should be this: https://github.com/mthmulders/openliberty-mvc/
I suspect the precompile isn't working because your jsp files are under WEB-INF, which isn't a public location for webapp files. Can you try moving them out from under WEB-INF and see if precompile then finds them?
You're right, @epj. When I move the JSP files to src/main/webapp, they're immediately compiled when the server starts. I wasn't aware of the requirement that they may not reside under WEB-INF.
OTOH, I feel it's not uncommon to store JSP files there, especially with frameworks like Struts, Spring Web or Krazo. I think the idea is that the user cannot invoke those views directly, if they'd know the path to the file, but only through those MVC-style frameworks.
Any update on this? I understand that the workaround is to move JSP files to src/main/webapp, but the JEE spec says that JSPs should be in the WEB-INF folder if you don't want them publically available.
There are situations where you want to install a WAR on a liberty server but you don't control how that WAR is is built where there are JSPs in WEB-INF folders per the convention above, and the JSP feature seems to miss them. Any change the JSP feature can support compiling JSPs from a WEB-INF location?
As long as you access a JSP file through an indirect means, such as
Describe the bug This issue is a follow-up on https://github.com/OpenLiberty/ci.maven/issues/838.
I'm trying to have OpenLiberty compile my JSP files on startup through the Maven goal, but that didn't work. @cherylking suggested to try it without that Maven goal by setting
<jspEngine prepareJsps="0" />
and<webContainer deferServletLoad="false" />
in server.xml, but that didn't work either.Steps to Reproduce
Take a sample application and add the following to server.xml:
Start the application using
mvn liberty:dev
.Expected behavior I would expect the designated scratchdir to contain class files for the JSP files in my application. This does not happen when I start the application. When I access it (with a web browser), those files appear. Since
deferServletLoad
is false I would expect it to happen when the application starts, not when it is accessed.Diagnostic information:
20.0.0.6
openjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
see above