Question

I'm trying to use Groovlets in place of JSPs in an integration framework but one of the vendor's libraries relies on the javax.servlet.jsp.PageContext available in a JSP. I found the GroovyPagesPageContext class that's part of Grails for GSPs.

Anyway to use Groovy in this situation and have a handle to the jsp PageContext? I have not tried using GSPs because there's a significant amount of logic involved.

Was it helpful?

Solution

Since you are replacing your JSPs with Groovlets which are Groovy Servlets, how are you using this vendor's library? If it relies on the JSP API, I'm assuming that it is normally used in a JSP, perhaps as a custom tag library? How are you using the library in a Groovlet? You would have the same problem trying to use a custom tag library inside a plain Servlet.

If you'd like a standalone class that can act as a stand-in for a JSP Page context, have a look at the JspPageContext.java class that I wrote for Rayures so that I could wrap a JSP tag library in plain Java code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top