> > The JSP2 specs clearly discourage their usage, in favour of the
> > alternatives it introduces (EL expressions, custom
> tags/functions, JSP
> > fragments). Consider them deprecated under JSP2.
>
>
> Ah, in that sense. I agree with that. However, plain old Java
> variables you define in a page are unreachable for the EL.
> The following will not produce any output (although you might
> argue that one should store variable 'a' inside the page
> context or somewhere else):
>
> <% String a = "qwerty"; %>
> ${a}
As you might have guessed, usage of scriptlets like this is discouraged
as well for similar.
However, as you point out yourself, this will do the job:
<% pageContext.setAttribute(a, "qwerty"); %>
If you really insist on using sciptlets, I think using the pageContext
like this is to be preferred over local variables. At least it will
promote better separation of business logic and separation logic.
Rob van Maris
Technical Consultant
Quantiq
xmedia & communication solutions