PDA

View Full Version : Spring JSP Interceptor where a PageContext is available?


matthewadams
Aug 9th, 2007, 06:39 PM
Hi,

I would like to be able to intercept in a vendor-neutral way the rendering of a JSP page and insert PageContext variables for the page to use. Is there a Spring interceptor that I can use that can give me a reference to the PageContext and intercept the JSP just before _jspService(..)?

I've done it using a tag, but that places a requirement on the page author to use the tag. I've also looked into providing a JSP page superclass, but that also requires the page author to use the JSP "extends" attribute, plus I can't do anything there anyway.*

Thanks,
Matthew

*: Even if the HttpJspPage superclass provided an implementation of _jspService(HttpServletRequest,HttpServletResponse ), it would be to do the work required, then delegate to something like _jspServiceInternal(HttpServletRequest,HttpServlet Response), and JSP-compliant containers are going to generate _jspService methods, not _jspServiceInternal methods. There are no jspPreService/jspPostService methods defined...