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

Andras Balogh andras at reea.net
Tue Dec 21 11:12:26 CET 2004


Hello,

You can create a test.jsp in OpenCms than take a look at the the 
temporary java file made by your servler container
(ex. in Tomcat: 
C:\jakarta-tomcat-5.0.16\work\Catalina\localhost\opencms\org\apache\jsp\WEB_002dINF\jsp\..)
I see something like this on my jsp:
 _jspxFactory = JspFactory.getDefaultFactory();
 response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,null, 
true, 8192, true);

Best regards,
Andras.

Xavier Ottolini wrote:

> 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
>
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please 
> visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
>




More information about the opencms-dev mailing list