[opencms-dev] How to instantiate a new CmsJspActionElement into a servlet ?

Xavier Ottolini xavier.ottolini at adelis.com
Tue Dec 21 10:53:31 CET 2004


Hi,

I would like to instantiate a new CmsJspActionElement into a servlet. 
Then my servlet should be able to find resources in the virtual file system.

If I want to create a new CmsJspActionElement, I need to instantiate a 
PageContext. That is a real problem.

JspFactory  factory     = JspFactory.getDefaultFactory();
errorUrl = http://www.mydomain.com/error.html
PageContext pageContext = 
factory.getPageContext(this,_request,_response,errorUrl,true,JspWriter.DEFAULT_BUFFER,true);

I get the following exception :

2004-12-21 10:37:36 PageContextImpl: creating out
java.lang.IllegalArgumentException: Buffer size <= 0
        at 
org.apache.jasper.runtime.JspWriterImpl.<init>(JspWriterImpl.java:130)
        at 
org.apache.jasper.runtime.PageContextImpl._createOut(PageContextImpl.java:543)
        at 
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:147)
        at 
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:114)
        at 
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:175)
        at 
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:154)
        at com.mycompany.MyServlet.goGet(MyServlet.java:100)

Has anybody any idea ?

Regards,

Xavier




More information about the opencms-dev mailing list