-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 10/24/2009 10:44 PM, Caldarale, Charles R wrote:
> Hmmm... I tried this simple JSP file under 6.0.20 with no problems:
> 
> <html>
> <%@ page session="false" import="java.util.*"%>
> <%!
> LinkedHashMap<String, String> menuItems = new LinkedHashMap<String, String>();
> public void jspInit() {
>   menuItems.put("testKey", "testVal");
> } %>
> <body>
> <p> testKey: <%= menuItems.get("testKey") %>
> </body>
> </html>
> 
> Perhaps there's a problem with whatever .jsp is pulling in the .jspf segment.

Perhaps something changed in Tomcat with respect to the %...@include
directive. Is it possible that the strategy in Tomcat 6.0.18 was
something like:

1. Scan the JSP file for "@page import"
2. Scan the JSP file for "%@ include"
3. Repeat steps 1 & 2 until there are no more files to process
4. Use the complete list of imports for class resolution
5. Compile the resulting complete file

Tomcat 6.0.20 might do this:

1. Use only the "@page import" list from the main JSP file
2. Process all the imports by including their content
3. Compile the resulting complete file

I can think of a few reasons to do things as described above for 6.0.20:

1. Multiple included files could produce conflicts (for instance,
   one files imports java.security.Certificate while another
   imports java.security.cert.Certificate).

2. The recursive scanning process is kind of a PITA.

The result, unfortunately, is that the top-level file must explicitly
import everything that the included files will use. Personally, I find
this distasteful, but I also find JSP itself distasteful, too, so I'm
kind of biased.

Alexander, try adding "@page import=java.util.LinkedHashMap" to your
top-level JSP and see if that fixes things.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrl03oACgkQ9CaO5/Lv0PC32gCfb5LbpAa/jh0P5RkrRfenYDjg
uXQAoLXkkhKYjJmPVW6aWeqgiQiOY5Lx
=frgK
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to