Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

changing the 'out' predefined variable ?

0 views
Skip to first unread message

Don Dwoske

unread,
Apr 2, 2003, 12:31:09 PM4/2/03
to
How should I (or should I not) change 'out' in my jsp
page... this is the root of my problem:

<%out = new PrintVxml(out,application.getInitParameter("vxmlVersion"),true);%>

I think PrintVxml is basically a decorator to the real 'out' and adds on
some other info.

This source code at the bottom
of the generated JSP throws an exception:

} catch (Throwable __ee) {
while (out != null && out != _originalOut) out = pageContext.popBody();
((weblogic.servlet.jsp.PageContextImpl)pageContext).
handlePageException((Throwable)__ee);
}

results in:

v2.0-october2001
<Apr 2, 2003 11:45:17 AM EST> <Error> <HTTP> <101017> <[ServletContext(id=6465034,na
cause of ServletException
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:77)
at java.util.Stack.pop(Stack.java:59)
at weblogic.servlet.jsp.PageContextImpl.popBody(PageContextImpl.java:321)


Should I do something like this in my JSP?

<%
pageContext.pushBody();
out = new PrintVxml(out,application.getInitParameter("vxmlVersion"),true);
%>

If so, should I call pageContext.popBody() before finishing?

Thanks for any help...

-Don

Nagesh Susarla

unread,
Apr 2, 2003, 1:42:00 PM4/2/03
to

changing the out implicit variable is not permitted by the spec. But you
could use an ServletResponseWrapper from within a filter or (an explicit
include/forward) to get the functionality you just described.
Infact using a wrapper would give you more control over the entire
response IMHO.
thanks
Nagesh

0 new messages