Testing tag
getting servlet Context to get Minor version 5
using application implicit object to get ContextPath /Test
" You don't have ServletContext though. A tag File uses JspContxt instead of ServletContext.."( Page 510.Qn1).
SCJP5.0, SCWCD5.0, OCEJPAD6, OCPJWSD6
Bindu Lakhanpal wrote:We can use scriptlets in Tag Files.
using pageContext to get ServletConfig jsp
using pagecontext to get ServletContext 2
You don't have a ServletContext, though - a Tag File uses a JspContext instead of a ServletContext.
SCJP5.0, SCWCD5.0, OCEJPAD6, OCPJWSD6
Alex Serna wrote: I read somewhere that you can cast that JspContext to PageContext in order to get the rest of objects(i.e. ServletContext)
Alex Serna wrote: but I think it said that this wasn't part of the specs and it depends on the Container being used...
The PageContext class is an abstract class, designed to be extended to provide implementation dependent implementations thereof, by conformant JSP engine runtime environments.
SCJP5.0, SCWCD5.0, OCEJPAD6, OCPJWSD6
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|