What you're describing works for me, i.e. I get the value of the java variable in my alert. Are scriptlets working at all on your page? Can your simply write out a variables value to the page body using a scriptlet? It could be possible that scriptlets are disabled for your application. Do you have anything similar to the following in your web.xml:
There may be other ways to disable scriptlets at the page or container level.
Joined: Sep 01, 2005
I don't have the code mentioned in my web.xml
I tried with System outs...and the values are coming out well. So, I'm sure scriptlets are enabled...
Oh, of course. I missed that fact that this was in a custom tag. So I take it bake... the problem is with your code.
You cannot use a scriptlet expression as part of the attribute to a custom action. It must be all of the attribute, or none.
EL expressions have no such restrictions, which is just one of the many reasons that you should no longer be using scriptlets if you are using a JSP 2.0 container. [ April 10, 2007: Message edited by: Bear Bibeault ]