I figured out the source of the problem. The scriptlets and expressions that weren't executing were in .jspf files. I needed to add the following servlet-mapping to the web.xml file in Tomcat's conf directory ...
Once I had done that, the scriptlets and expressions executed correctly.
Bear Bibeault wrote:You should not have to add that mapping. In fact, it's a bad idea to do so.
The .jspf file type should only be used on files included via the include directive. Files included with the include action should have a file type of .jsp.
I didn't know that. Our .jspf files are being "included" using the Apache Tiles 2 framework. I'm curious why it's a "bad idea" to use the .jspf extension the way we are. I don't doubt that it is ... otherwise the .jspf servlet-mapping would have been included in the default web.xml ... just curious as to why.
Because, by convention, the .jspf file type is exclusively for static JSP fragments that are included via the include directive. This means that they are not interpreted at the time of inclusion, but along with the including page, and do not need to be syntactically complete JSP files. Files included in places where the interpretation happens at include time should use the .jsp file type so that they are properly processed by the JSP engine without the need for unconventional mappings, and must be syntactically complete JSPs.
The "f" in .jspf stands for "fragment". Statically included files can be fragments, dynamically included files cannot be. So naming them .jspf is not only unconventional, but a misrepresentation of the contents of the file.
subject: Scriptlets and expressions not executing in JSP page